Important: The information in this document is obsolete and should not be used for new development.
Inherits from | |
Package | com.apple.cocoa.application |
Companion guide |
NSHelpManager provides an approach to displaying online help. An application contains one instance of NSHelpManager. Your application’s code rarely needs to access NSHelpManager directly. Instead, you use Interface Builder and Xcode to set up online help for your application.
Returns true
if the application is currently in context-sensitive help mode, false
otherwise.
public static boolean isContextHelpModeActive
()
In context-sensitive help mode, when a user clicks a user interface item, help for that item is displayed in a small window just below the cursor.
Controls context-sensitive help mode.
public static void setContextHelpModeActive
(boolean flag)
If flag is true
, the application enters context-sensitive help mode. If flag is false
, the application returns to normal operation.
You never send this message directly; instead, the NSApplication method activateContextHelpMode
activates context-sensitive help mode, and the first mouse click after displaying the context-sensitive help window deactivates it.
When the application enters context-sensitive help mode, NSHelpManager posts a ContextHelpModeDidActivateNotification
to the default notification center. When the application returns to normal operation, NSHelpManager posts a ContextHelpModeDidDeactivateNotification
.
Returns the shared NSHelpManager instance, creating it if it does not already exist.
public static NSHelpManager sharedHelpManager
()
Returns context-sensitive help for object.
public NSAttributedString contextHelpForObject
(Object object)
Performs a search for the specified string in the specified book.
public void findString
(String query, String book)
The query parameter specifies the search string, and book should be a localized help book name or null
. If book is null
, all installed help books are searched.
This is a wrapper for AHRegisterHelpBook
(which is called only once to register the help book specified in the application's main bundle) and AHSearch
.
Finds and displays the text at the given anchor location in the given book.
public void openHelpAnchor
(String anchor, String book)
The anchor parameter is a string specifying the anchor location, and book should be a localized help book name or null
. If book is null
, all installed help books are searched.
This method is a wrapper for AHRegisterHelpBook
(which is called only once to register the help book specified in the application's main bundle) and AHLookupAnchor
.
Removes the association between object and its context-sensitive help.
public void removeContextHelpForObject
(Object object)
If object does not have context-sensitive help associated with it, this method does nothing. Typically, you use Interface Builder to remove context-sensitive help from an item.
Associates help with object.
public void setContextHelpForObject
(NSAttributedString help, Object object)
When the application enters context-sensitive help mode, if object is clicked, help will appear in the context-sensitive help window. Typically, you use Interface Builder to associate context-sensitive help with an object.
Displays the context-sensitive help for object at or near the point on the screen specified by point.
public boolean showContextHelpForObject
(Object object, NSPoint point)
This point is usually just under the cursor. Returns true
if it successfully displays context-sensitive help for the object, false
if it cannot (for example, if there is no context-sensitive help associated with this object).
Posted when the application enters context-sensitive help mode. This typically happens when the user holds down the Help key.
The notification object is the NSHelpManager object. This notification does not contain a userInfo dictionary.
Posted when the application exits context-sensitive help mode. This happens when the user clicks the mouse button while the cursor is anywhere on the screen after displaying a context-sensitive help topic.
The notification object is the NSHelpManager object. This notification does not contains a userInfo dictionary.
© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)