scottc@net-community.com
)far@ix.netcom.com
)richard@brainstorm.co.uk
)The one and only application class
Copyright: (C) 1996,1999 Free Software Foundation, Inc.
- Declared in:
- AppKit/NSApplication.h
- Conforms to:
- NSCoding
Standards:
- MacOS-X
- OpenStep
- GNUstep
Description forthcoming.
Description forthcoming.
Return the shared application instance, creating one (of the receiver class) if needed. There is (and must always be) only a single shared application instance for each application. After the shared application instance has been created, you can access it directly via the global variable NSApp (but not before!). When the shared application instance is created, it is also automatically initialized (that is, its -init method is called), which connects to the window server and prepares the gui library for actual operation. For this reason, you must always call [NSApplication sharedApplication] before using any functionality of the gui library - so, normally, this should be one of the first commands in your program (if you use NSApplicationMain() , this is automatically done). The shared application instance is normally an instance of NSApplication; but you can subclass NSApplication, and have an instance of your own subclass be created and used as the shared application instance. If you want to get this result, you need to make sure the first time you call +sharedApplication is on your custom NSApplication subclass (rather than on NSApplication). Putting [MyApplicationClass sharedApplication]; as the first command in your program is the recommended way. :-) If you use NSApplicationMain() , it automatically creates the appropriate instance (which you can control by editing the info dictionary of the application). It is not safe to call this method from multiple threads - it would be useless anyway since the whole library is not thread safe: there must always be at most one thread using the gui library at a time. (If you absolutely need to have multiple threads in your application, make sure only one of them uses the gui [the 'drawing' thread], and the other ones do not).
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Set up modal session for theWindow, and, if it is not visible already, puts it up on screen, centering it if it is an NSPanel. It is then ordered front and made key or main window.
Description forthcoming.
Description forthcoming.
Changes the Window menu item associated with
aWindow to aString. If no
associated window item exists, one is created.
If isFilename is YES
, then
aString is assumed to be a filename
representation the way
[NSWindow -setTitleWithRepresentedFilename:]
would format it, otherwise the string is displayed literally in the menu item.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Returns the applications delegate, as set by the
-setDelegate:
method.
The application delegate will automatically be sent
various notifications (as long as it implements
the appropriate methods) when application events
occur. The method to handle each of these
notifications has name mirroring the
notification name, so for instance an
NSApplicationDidBecomeActiveNotification is
handled by an
applicationDidBecomeActive:
method.
The delegate is also sent various messages to ask for authorisation to perform actions, or to ask it to perform actions (again, as long as it implements the appropriate methods).
The delegate is also called upon to respond to any actions which are not handled by a window, a window delgate, or by the application object itsself.. This is controlled by the -targetForAction: method.
Finally, the application delegate is responsible for handling messages sent to the application from remote processes (see the section documenting distributed objects for NSPasteboard ).
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Returns the main menu of the receiver.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Returns the window that is part of the current modal session, if any.
Description forthcoming.
Calls
-orderFrontStandardAboutPanelWithOptions:
with nil
passed as the options dictionary.
Calls -orderFrontStandardInfoPanelWithOptions:
Calls
-orderFrontStandardInfoPanelWithOptions:
with nil
passed as the options dictionary.
Orders front the standard info panel for the
application, taking the needed information
from the dictionary
argument. There is a single standard info panel
per application; it is created the first time that
this method is invoked, and then reused in all
subsequent calls. The application standard
info panel is immutable and can not be changed after
creation. Useful keys for the
dictionary
are:
Info-gnustep.plist
file is searched
for the value of ApplicationName
followed by
NSHumanReadableShortName. If this also
fails, the string returned by
[NSProcessInfo -processName]
is used.
Info-gnustep.plist
is searched for that key; if this fails, no
application description is shown.
Info-gnustep.plist
is searched for ApplicationIcon; if this
fails,
[NSApp -applicationIconImage]
is used instead.
Info-gnustep.plist
is
searched for ApplicationRelease or
NSAppVersion, otherwise,
"Unknown" is used.
Info-gnustep.plist
is looked
for NSBuildVersion. If all fails, no
full version is shown.
Info-gnustep.plist
is
searched for Authors, if this
fails, "Unknown" is displayed.
Info-gnustep.plist
is searched for
Copyright and then (failing this) for
NSHumanReadableCopyright. If all
fails,
"Copyright Information Not Available"
is used.
Info-gnustep.plist
is searched for CopyrightDescription. If
this fails, no copyright description is shown.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Accepts an array of sendTypes and an array of returnTypes.
Description forthcoming.
Perform the actual application termination.
Description forthcoming.
Description forthcoming.
This method starts the main event loop of the application.
Starts modal event loop for given window, after calling -beginModalSessionForWindow: . Loop is broken only by stopModal:, -stopModalWithCode: , or -abortModal: , at which time -endModalSession: is called.
Description forthcoming.
Processes any events for a modal session described by the theSession variable. When finished, it returns the state of the session (i.e. whether it is still running or has been stopped, etc)
If there are no pending events for the session, this method returns immediately.
Although Apple's docs state that, before processing the events, it makes the session window key and orders the window front, this method does not attempt to do this, because: 1) we don't want to interfere with use of other apps during modal session for this app; 2) occasionally other windows are active and should be usable during modal sessions (e.g., a popup dialog from a modal window); 3) most of the time -beginModalSessionForWindow: will have been called in advance. If the latter is not the case, you may need to order the window front yourself in advance.
See Also: -runModalForWindow:
Sends the aSelector message to the
receiver returned by the
-targetForAction:to:from:
method (to which the aTarget and
sender arguments are passed).
The
method in the receiver must expect a single argument
... the sender.
Any value returned by
the method in the receiver is ignored.
This
method returns YES
on success,
NO
on failure (when no receiver can be
found for aSelector).
Description forthcoming.
Return the services menu of the receiver.
Returns the services provided previously registered using the -setServicesProvider: method.
Description forthcoming.
Sets the application's icon. Any windows that use the old application icon image as their mini window image will be updated to use the new image.
Sets the delegate of the application to
anObject.
Beware, this does not retain
anObject, so you must be sure that, in
the event of anObject being deallocated,
you stop it being the application delagate by calling
this method again with another object (or
nil
) as the argument.
Sets the main menu of the receiver
Sets the services menu for the receiver.
Sets the object which provides services to other
applications.
Passing a
nil
value for anObject will
result in the provision of services to other
applications by this application being
disabled.
See
NSPasteboard
for information about providing services.
Sets the windows menu of the receiver. The windows menu keeps track of all windows open in the application.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Returns the target object that will respond to aSelector, if any. The method first checks if any of the key window's first responders, the key window or its delegate responds. Next it checks the main window in the same way. Finally it checks the receiver (NSApplication) and it's delegate.
If theTarget responds to theAction
it is returned, otherwise the application searches for
an object which will handle theAction and
returns the first object found.
Returns
nil
on failure.
Terminates the application.
Attempts to perform aSelector using
[NSResponder -tryToPerform:with:]
and if that is not possible, attempts to get the application delegate to perform the aSelector.
Returns YES
if an object was found to perform aSelector, NO
otherwise.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
- Declared in:
- AppKit/NSApplication.h
Standards:
- NotOpenStep
- NotMacOS-X
- GNUstep
Description forthcoming.
Method summaryWarning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
- Declared in:
- AppKit/NSApplication.h
Standards:
- MacOS-X
- OpenStep
- GNUstep
Description forthcoming.
Method summaryDescription forthcoming.
Description forthcoming.
Description forthcoming.
- Declared in:
- AppKit/NSApplication.h
Standards:
- NotOpenStep
- NotMacOS-X
- GNUstep
Description forthcoming.
Method summaryDescription forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.