Public Member Functions | |
| (id) | - init [implementation] |
| (void) | - setDelegate: [implementation] |
| (id) | - delegate [implementation] |
| (void) | - finishLaunching [implementation] |
| (void) | - run [implementation] |
| (void) | - runModalForWindow: [implementation] |
| (void) | - stopModalWithCode: [implementation] |
| (void) | - stopModal [implementation] |
| (void) | - abortModal [implementation] |
| (CPModalSession) | - beginModalSessionForWindow: [implementation] |
| (void) | - runModalSession: [implementation] |
| (CPWindow) | - modalWindow [implementation] |
| (void) | - sendEvent: [implementation] |
| (void) | - doCommandBySelector: [implementation] |
| (CPWindow) | - keyWindow [implementation] |
| (CPWindow) | - mainWindow [implementation] |
| (CPWindow) | - windowWithWindowNumber: [implementation] |
| (CPArray) | - windows [implementation] |
| (CPMenu) | - mainMenu [implementation] |
| (void) | - setMainMenu: [implementation] |
| (void) | - orderFrontStandardAboutPanel: [implementation] |
| (void) | - orderFrontStandardAboutPanelWithOptions: [implementation] |
| (BOOL) | - tryToPerform:with: [implementation] |
| (BOOL) | - sendAction:to:from: [implementation] |
| (id) | - targetForAction:to:from: [implementation] |
| (id) | - targetForAction: [implementation] |
| (void) | - setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue: [implementation] |
| (CPEvent) | - setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue: [implementation] |
| (void) | - beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: [implementation] |
| (CPArray) | - arguments [implementation] |
| (void) | - setArguments: [implementation] |
| (CPDictionary) | - namedArguments [implementation] |
Static Public Member Functions | |
| (CPApplication) | + sharedApplication [implementation] |
CPApplicationMain function. A simple example looks like this:
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
-(void)applicationDidFinishLaunching:(CPNotification)aNotification; Sent from the notification center after the app initializes, but before receiving events.
| aNotification | contains information about the event |
| aNotification | contains information about the event |
Definition at line 69 of file CPApplication.j.
| - (void) abortModal | [implementation] |
Aborts the event loop started by runModalForWindow:
Definition at line 343 of file CPApplication.j.
| - (CPArray) arguments | [implementation] |
Definition at line 680 of file CPApplication.j.
| - (CPModalSession) beginModalSessionForWindow: | (CPWindow) | aWindow | [implementation] |
Sets up a modal session with theWindow.
| aWindow | the window to set up the modal session for |
Definition at line 352 of file CPApplication.j.
| - (void) beginSheet: | (CPWindow) | aSheet | ||
| modalForWindow: | (CPWindow) | aWindow | ||
| modalDelegate: | (id) | aModalDelegate | ||
| didEndSelector: | (SEL) | aDidEndSelector | ||
| contextInfo: | (id) | aContextInfo | ||
[implementation] |
Displays a window as a sheet.
| aSheet | the window to display as a sheet | |
| aWindow | the window that will hold the sheet as a child | |
| aModalDelegate | ||
| aDidEndSelector | ||
| aContextInfo |
Definition at line 675 of file CPApplication.j.
| - (id) delegate | [implementation] |
Returns the application's delegate. The app can only have one delegate at a time.
Definition at line 231 of file CPApplication.j.
| - (void) doCommandBySelector: | (SEL) | aSelector | [implementation] |
Definition at line 421 of file CPApplication.j.
| - (void) finishLaunching | [implementation] |
This method is called by run before the event loop begins. When it successfully completes, it posts the notification CPApplicationDidFinishLaunchingNotification. If you override finishLaunching, the subclass method should invoke the superclass method.
Definition at line 242 of file CPApplication.j.
| - (id) init | [implementation] |
Initializes the Document based application with basic menu functions. Functions are New, Open, Undo, Redo, Save, Cut, Copy, Paste.
Definition at line 110 of file CPApplication.j.
| - (CPWindow) keyWindow | [implementation] |
Returns the key window.
Definition at line 432 of file CPApplication.j.
| - (CPMenu) mainMenu | [implementation] |
Returns the application's main menu
Definition at line 465 of file CPApplication.j.
| - (CPWindow) mainWindow | [implementation] |
Returns the main window.
Definition at line 440 of file CPApplication.j.
| - (CPWindow) modalWindow | [implementation] |
Returns the window for the current modal session. If there is no modal session, it returns nil.
Definition at line 380 of file CPApplication.j.
| - (CPDictionary) namedArguments | [implementation] |
Definition at line 723 of file CPApplication.j.
| - (void) orderFrontStandardAboutPanel: | (id) | aSender | [implementation] |
Definition at line 479 of file CPApplication.j.
| - (void) orderFrontStandardAboutPanelWithOptions: | (CPDictionary) | aDictionary | [implementation] |
Definition at line 484 of file CPApplication.j.
| - (void) run | [implementation] |
Calls finishLaunching method which results in starting the main event loop.
Definition at line 283 of file CPApplication.j.
| - (void) runModalForWindow: | (CPWindow) | aWindow | [implementation] |
Starts a modal event loop for aWindow
| aWindow | the window to start the event loop for |
Definition at line 293 of file CPApplication.j.
| - (void) runModalSession: | (CPModalSession) | aModalSession | [implementation] |
Runs a modal session
| CPModalSession | the session to run |
Definition at line 361 of file CPApplication.j.
| - (BOOL) sendAction: | (SEL) | anAction | ||
| to: | (id) | aTarget | ||
| from: | (id) | aSender | ||
[implementation] |
Sends an action to a target.
| anAction | the action to send | |
| aTarget | the target for the action | |
| aSender | the action sender |
YES Definition at line 524 of file CPApplication.j.
| - (void) sendEvent: | (CPEvent) | anEvent | [implementation] |
Dispatches events to other objects.
| anEvent | the event to dispatch |
Definition at line 401 of file CPApplication.j.
| - (void) setArguments: | (CPArray) | args | [implementation] |
Definition at line 688 of file CPApplication.j.
| - (void) setCallback: | (Function) | aCallback | ||
| forNextEventMatchingMask: | (unsigned int) | aMask | ||
| untilDate: | (CPDate) | anExpiration | ||
| inMode: | (CPString) | aMode | ||
| dequeue: | (BOOL) | shouldDequeue | ||
[implementation] |
Definition at line 653 of file CPApplication.j.
| - (void) setDelegate: | (id) | aDelegate | [implementation] |
Sets the delegate for this application. The delegate will receive various notifications caused by user interactions during the application's run. The delegate can choose to react to these events.
| aDelegate | the delegate object |
Definition at line 191 of file CPApplication.j.
| - (void) setMainMenu: | (CPMenu) | aMenu | [implementation] |
Sets the main menu for the application
| aMenu | the menu to set for the application |
Definition at line 474 of file CPApplication.j.
| - (CPEvent) setTarget: | (id) | aTarget | ||
| selector: | (SEL) | aSelector | ||
| forNextEventMatchingMask: | (unsigned int) | aMask | ||
| untilDate: | (CPDate) | anExpiration | ||
| inMode: | (CPString) | aMode | ||
| dequeue: | (BOOL) | shouldDequeue | ||
[implementation] |
Definition at line 660 of file CPApplication.j.
| + (CPApplication) sharedApplication | [implementation] |
Returns the singleton instance of the running application. If it doesn't exist, it will be created, and then returned.
Definition at line 97 of file CPApplication.j.
| - (void) stopModal | [implementation] |
Stops the modal event loop
Definition at line 335 of file CPApplication.j.
| - (void) stopModalWithCode: | (int) | aCode | [implementation] |
Stops the event loop started by runModalForWindow: and sets the code that runModalForWindow: will return.
| aCode | the return code for the modal event |
Definition at line 303 of file CPApplication.j.
| - (id) targetForAction: | (SEL) | anAction | [implementation] |
Looks for a target that can handle the specified action. Checks for a target in the following order:
| anAction | the action to handle |
nil if no match could be found Definition at line 626 of file CPApplication.j.
| - (id) targetForAction: | (SEL) | anAction | ||
| to: | (id) | aTarget | ||
| from: | (id) | aSender | ||
[implementation] |
Finds a target for the specified action. If the action is nil, returns nil. If the target is not nil, aTarget is returned. Otherwise, it calls targetForAction: to search for a target.
| anAction | the action to find a target for | |
| aTarget | if not nil, this will be returned not used |
Definition at line 547 of file CPApplication.j.
| - (BOOL) tryToPerform: | (SEL) | anAction | ||
| with: | (id) | anObject | ||
[implementation] |
Tries to perform the action with an argument. Performs the action on itself (if it responds to it), then tries to perform the action on the delegate.
| anAction | the action to perform. | |
| anObject | the argument for the action method |
YES if the action was performed Definition at line 499 of file CPApplication.j.
| - (CPArray) windows | [implementation] |
Returns an array of the application's CPWindows
Definition at line 456 of file CPApplication.j.
| - (CPWindow) windowWithWindowNumber: | (int) | aWindowNumber | [implementation] |
Returns the CPWindow object corresponding to aWindowNumber.
Definition at line 448 of file CPApplication.j.
1.5.8