Re: Context Help
Re: Context Help
- Subject: Re: Context Help
- From: Ali Ozer <email@hidden>
- Date: Fri, 6 Jul 2001 11:43:55 -0700
>
How do I implement context help in a Cocoa application?
>
>
The topic "Implementing Context Help" in the Project Builder Cocoa Help
>
says that I need to add my rtf files in Project Builder "under Context
>
Help". What does this mean? I can't find any place named "Context
>
Help" to add my file to.
Traces of context help have vanished from IB and PB, unfortunately. That
was because of the uncertainty in what we wanted to do with it long
term. This invalidates some of the description in the NSHelpManager
documentation.
However, the context help APIs do work, and should continue to do so
even if we add more features in the future. You can:
- assign context help (rich text, in the form of an NSAttributedString)
to any UI object
- click on "Help" to get a one-shot modal "?" cursor, with which you can
click on elements and get context help in a sort of (currently) ugly
window
- go to context help mode programmatically (so you can have a toolbar
button for it, for instance) or even bring up context help item on an
element programmatically
- get notifications (context help activated/deactivated), allowing apps
to do fancier things when the context help mode is entered
Without IB/PB support, it's a bit messy to take advantage of the context
help files as described in the documentation. Best is to probably assign
your own help items using setContextHelp:forObject:. You can read the
attributed strings from localizable RTF files in your project, but you
probably don't want to have dozens of files which you load all at app
launch. You can maybe coalesce them into one file, or load them the
first time context help is activated. (The compileHelp stuff was useful
for combining all the context help entries, but without PB/IB support
it's not accessible.)
Ali