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] |
(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] |
(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 64 of file CPApplication.j.
- (void) abortModal | [implementation] |
Aborts the event loop started by runModalForWindow:
Definition at line 337 of file CPApplication.j.
- (CPArray) arguments | [implementation] |
Definition at line 664 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 346 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 659 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 225 of file CPApplication.j.
- (void) doCommandBySelector: | (SEL) | aSelector | [implementation] |
Definition at line 415 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 236 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 104 of file CPApplication.j.
- (CPWindow) keyWindow | [implementation] |
Returns the key window.
Definition at line 426 of file CPApplication.j.
- (CPMenu) mainMenu | [implementation] |
Returns the application's main menu
Definition at line 459 of file CPApplication.j.
- (CPWindow) mainWindow | [implementation] |
Returns the main window.
Definition at line 434 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 374 of file CPApplication.j.
- (CPDictionary) namedArguments | [implementation] |
Definition at line 669 of file CPApplication.j.
- (void) run | [implementation] |
Calls finishLaunching
method which results in starting the main event loop.
Definition at line 277 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 287 of file CPApplication.j.
- (void) runModalSession: | (CPModalSession) | aModalSession | [implementation] |
Runs a modal session
CPModalSession | the session to run |
Definition at line 355 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 508 of file CPApplication.j.
- (void) sendEvent: | (CPEvent) | anEvent | [implementation] |
Dispatches events to other objects.
anEvent | the event to dispatch |
Definition at line 395 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 637 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 185 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 468 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 644 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 91 of file CPApplication.j.
- (void) stopModal | [implementation] |
Stops the modal event loop
Definition at line 329 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 297 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 610 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 531 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 483 of file CPApplication.j.
- (CPArray) windows | [implementation] |
Returns an array of the application's CPWindows
Definition at line 450 of file CPApplication.j.
- (CPWindow) windowWithWindowNumber: | (int) | aWindowNumber | [implementation] |
Returns the CPWindow object corresponding to aWindowNumber
.
Definition at line 442 of file CPApplication.j.