• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /macosx-10.9.5/RubyCocoa-80/RubyCocoa/template/ProjectBuilder/Application/Cocoa-Ruby Document-based Application/
1#
2#  MyDocument.rb
3#  �PROJECTNAME�
4#
5#  Created by �FULLUSERNAME� on �DATE�.
6#  Copyright (c) �YEAR� �ORGANIZATIONNAME�. All rights reserved.
7#
8
9
10require 'osx/cocoa'
11
12class MyDocument < OSX::NSDocument
13
14  def windowNibName
15    # Override returning the nib file name of the document If you need
16    # to use a subclass of NSWindowController or if your document
17    # supports multiple NSWindowControllers, you should remove this
18    # method and override makeWindowControllers instead.
19    return "MyDocument"
20  end
21
22  def windowControllerDidLoadNib(aController)
23    super_windowControllerDidLoadNib(aController)
24    # Add any code here that need to be executed once the
25    # windowController has loaded the document's window.
26  end
27
28  def dataRepresentationOfType(aType)
29    # Insert code here to write your document from the given data.
30    # You can also choose to override
31    # fileWrapperRepresentationOfType or writeToFile_ofType
32    # instead.
33    return nil
34  end
35
36  def loadDataRepresentation_ofType(data, aType)
37    # Insert code here to read your document from the given data.  You
38    # can also choose to override
39    # loadFileWrapperRepresentation_ofType or readFromFile_ofType
40    # instead.
41    return true
42  end
43end
44