Re: Can't pipe files to compileHelp
Re: Can't pipe files to compileHelp
- Subject: Re: Can't pipe files to compileHelp
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 04 Aug 2002 12:23:56 -0400
on 02-08-04 10:55 AM, Andy Lee at email@hidden wrote:
>
I had forgotten about xargs. I think Cameron is right about this
>
difference. If there is a very large number of arguments in an
>
expanded command line, I *think* it can exceed some maximum command
>
length.
Thanks, I'll keep that in mind.
Somebody asked me off list why I care about compileHelp. I thought my answer
might be of general interest, so here it is (pardon the soap boxish tone):
I'm implementing context help in my application, in order to put rtf and
rtfd styles and images into yellow context help boxes near my user controls.
The user can view them by pressing the Help key on the keyboard to get the
question mark cursor, then clicking on a user control.
This is less intrusive than Tool Tips, which appear after every pause over a
user control, so I can afford to put more information in them without
offending my power users -- even images, if they are helpful. Context help
boxes can be much larger than Tool Tips, so they are a nice second line of
help for less experienced users, somewhere between Tool Tips and Apple Help.
I noticed that most Mac OS X applications give you the question mark cursor
when you press the Help key, but you just get a beep when you click on a
user control because almost nobody implements context help. That's bad
application design, even if most users don't discover it. I believe context
help should be implemented, and I think Apple should bring back the old IB
and PB support for it. I like being able to give my users lengthier,
prettier context help boxes than are feasible with Tool Tips. (I was a fan
of balloon help, too.)
The support for doing this without code in IB and PB was removed a while
ago, but the API to do it programmatically is still there and presumably
always will be.
This call in my window controller's awakeFromNib method does the trick for
my checkbox control:
[[NSHelpManager sharedHelpManager] setContextHelp:[[NSBundle mainBundle]
contextHelpForKey:@"checkbox.rtf"] forObject:[self checkbox]];
I found the following message in the list archives from Ali Ozer a year ago.
His last sentence may explain why I get a permissions error when I try to
run the compileHelp tool from a script build phase in PB, but I'm not sure.
--->
FROM: Ali Ozer
DATE: 2001-07-06 20:43
>
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.)
<---
Most of his last paragraph is a little puzzling. You can put a zillion
individual *Help.rtf files in, say, the English.lproj folder in your project
folder, but uncheck them so they don't get loaded into the built application
bundle to take up time when the app is launched. That way they're there in
the project folder where they won't get lost, ready for your localization
contractor to go to work on them. All that gets placed in the built
application bundle is the Help.plist file generated using the compileHelp
tool.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.