![]() |
API
0.9.6
|
#import <CPApplication.h>
Class Methods | |
(CPString) | + defaultThemeName |
(CPApplication) | + sharedApplication |
![]() | |
(BOOL) | + accessInstanceVariablesDirectly |
(id) | + alloc |
(id) | + allocWithCoder: |
(BOOL) | + automaticallyNotifiesObserversForKey: |
(Class) | + class |
(void) | + exposeBinding: |
(void) | + initialize |
(IMP) | + instanceMethodForSelector: |
(BOOL) | + instancesRespondToSelector: |
(BOOL) | + isSubclassOfClass: |
(CPSet) | + keyPathsForValuesAffectingValueForKey: |
(void) | + load |
(id) | + new |
(void) | + setVersion: |
(Class) | + superclass |
(int) | + version |
Additional Inherited Members | |
![]() | |
Class | isa |
CPApplication is THE way to start up the Cappuccino framework for your application to use. Every GUI application has exactly one instance of CPApplication (or of a custom subclass of CPApplication). Your program's main() function can create that instance by calling the 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 |
-(void)applicationWillFinishLaunching:(CPNotification)aNotification; Sent from the notification center before the app is initialized.
aNotification | contains information about the event |
Starts the GUI and Cappuccino frameworks. This function should be called from the main()
function of your program.
Definition at line 2 of file CPApplication.h.
|
implementation |
Aborts the event loop started by -runModalForWindow
:
Definition at line 516 of file CPApplication.j.
|
implementation |
Definition at line 422 of file CPApplication.j.
|
implementation |
Returns the application icon image. By default this is pulled from the CPApplicationIcon key of info.plist.
Definition at line 307 of file CPApplication.j.
|
implementation |
Returns and array of slash seperated arugments to your application. These values are pulled from your window location hash.
For exampled if your application loaded:
index.html#280north/cappuccino/issues
The follow array would be returned:
["280north", "cappuccino", "issues"]
Definition at line 1024 of file CPApplication.j.
|
implementation |
Sets up a modal session with theWindow
.
aWindow | the window to set up the modal session for |
Definition at line 525 of file CPApplication.j.
|
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 947 of file CPApplication.j.
|
implementation |
Returns the last event recieved by your application.
Definition at line 932 of file CPApplication.j.
|
implementation |
Definition at line 432 of file CPApplication.j.
|
implementation |
Definition at line 1191 of file CPApplication.j.
|
implementation |
Returns the application's delegate. The app can only have one delegate at a time.
Definition at line 199 of file CPApplication.j.
|
implementation |
If the delegate responds to the given selector it will call the method on the delegate, otherwise the method will be passed to CPResponder.
Reimplemented from CPResponder.
Definition at line 632 of file CPApplication.j.
|
implementation |
Ends a sheet and sends the return code "0".
sheet | - The CPWindow object (sheet) that should be dismissed. |
Definition at line 1003 of file CPApplication.j.
Ends a sheet modal. The following are predefined return codes:
CPRunStoppedResponse CPRunAbortedResponse CPRunContinuesResponse
sheet | - The window object (sheet) to dismiss. |
returnCode | - The return code to send to the delegate. You can use one of the return codes above or a custom value that you define. |
Definition at line 981 of file CPApplication.j.
|
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 210 of file CPApplication.j.
|
implementation |
Definition at line 689 of file CPApplication.j.
|
implementation |
Definition at line 447 of file CPApplication.j.
|
implementation |
Initializes the Document based application with basic menu functions. Functions are New
, Open
, Undo
, Redo
, Save
, Cut
, Copy
, Paste
.
Reimplemented from CPObject.
Definition at line 126 of file CPApplication.j.
|
implementation |
Definition at line 442 of file CPApplication.j.
|
implementation |
Returns the key window.
Definition at line 643 of file CPApplication.j.
|
implementation |
Returns the application's main menu
Definition at line 698 of file CPApplication.j.
|
implementation |
Returns the main window.
Definition at line 651 of file CPApplication.j.
|
implementation |
Returns the window for the current modal session. If there is no modal session, it returns nil
.
Definition at line 554 of file CPApplication.j.
|
implementation |
Returns a dictionary of the window location named arguments. For example if your location was:
index.html?owner=280north&repo=cappuccino&type=issues
a CPDictionary with the keys:
owner, repo, type
and respective values:
280north, cappuccino, issues
Will be returned.
Definition at line 1111 of file CPApplication.j.
|
implementation |
Returns an array of visible CPWindow objects, ordered by their front to back order on the screen.
Definition at line 680 of file CPApplication.j.
|
implementation |
|
implementation |
Opens the standard about panel with no options.
Definition at line 322 of file CPApplication.j.
|
implementation |
Opens the standard about panel. This method takes a single argument options
. Options is a dictionary that can contain any of the following keys:
ApplicationName - The name of your application. ApplicationIcon - Application icon image. Version - The full version of your application ApplicationVersion - The shorter version number of your application. Copyright - Human readable copyright information.
If you choose not the include any of the above keys, they will default to the following respective keys in your info.plist file.
CPBundleName CPApplicationIcon (through a call to -applicationIconImage, see documentation for that method for more details) CPBundleVersion CPBundleShortVersionString CPHumanReadableCopyright
options | - A dictionary with the aboe listed keys. You can pass nil to default to your plist values. |
Definition at line 351 of file CPApplication.j.
|
implementation |
Definition at line 413 of file CPApplication.j.
|
implementation |
Calls -finishLaunching
method which results in starting the main event loop.
Definition at line 456 of file CPApplication.j.
|
implementation |
Starts a modal event loop for aWindow
aWindow | the window to start the event loop for |
Definition at line 466 of file CPApplication.j.
|
implementation |
Runs a modal session
CPModalSession | the session to run |
Definition at line 534 of file CPApplication.j.
|
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 772 of file CPApplication.j.
|
implementation |
Dispatches events to other objects.
anEvent | the event to dispatch |
Definition at line 573 of file CPApplication.j.
|
implementation |
Sets the applications icon image. This image is used in the default "About" window. By default this value is pulled from the CPApplicationIcon key in your info.plist file.
anImage | - The image to set. |
Definition at line 298 of file CPApplication.j.
|
implementation |
Sets the arguments of your application. That is, set the slash seperated values of an array as the window location hash.
For example if you pass an array:
["280north", "cappuccino", "issues"]
The new window location would be
index.html#280north/cappuccino/issues
args | - An array of arguments. |
Definition at line 1049 of file CPApplication.j.
|
implementation |
Fires a callback function when an event matching a given mask occurs.
aCallback | - A js function to be fired. aMask - An event mask for the next event. |
anExpiration | - The date for which this callback expires (not implemented). |
inMode | (not implemented). |
shouldDequeue | (not implemented). |
Definition at line 908 of file CPApplication.j.
|
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 150 of file CPApplication.j.
|
implementation |
Sets the main menu for the application
aMenu | the menu to set for the application |
Definition at line 707 of file CPApplication.j.
|
implementation |
Reimplemented from CPResponder.
Definition at line 712 of file CPApplication.j.
|
implementation |
Assigns a target and action for the next event matching a given event mask. The callback method called will be passed the CPEvent when it fires.
aTarget | - The target object for the callback. |
aSelector | - The selector which should be called on the target object. |
aMask | - The mask for a given event which should trigger the callback. |
anExpiration | - The date for which the callback expires (not implemented). |
aMode | (not implemented). |
shouldDequeue | (not implemented). |
Definition at line 924 of file CPApplication.j.
|
implementation |
Synthesized accessor method.
Provided by category CPApplication(CPSynthesizedAccessors).
Definition at line 1449 of file CPApplication.j.
|
implementation |
Returns the singleton instance of the running application. If it doesn't exist, it will be created, and then returned.
Definition at line 113 of file CPApplication.j.
|
implementation |
Stops the modal event loop
Definition at line 508 of file CPApplication.j.
|
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 476 of file CPApplication.j.
|
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 873 of file CPApplication.j.
|
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 795 of file CPApplication.j.
|
implementation |
Definition at line 274 of file CPApplication.j.
|
implementation |
Synthesized accessor method.
Provided by category CPApplication(CPSynthesizedAccessors).
Definition at line 1441 of file CPApplication.j.
|
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 Reimplemented from CPResponder.
Definition at line 747 of file CPApplication.j.
|
implementation |
Returns an array of the application's CPWindows
Definition at line 671 of file CPApplication.j.
|
implementation |
Returns the CPWindow object corresponding to aWindowNumber
.
Definition at line 659 of file CPApplication.j.