discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Discuss-gnustep Digest, Vol 2, Issue 49


From: Jonathan Gapen
Subject: Re: Discuss-gnustep Digest, Vol 2, Issue 49
Date: Tue, 21 Jan 2003 00:59:32 -0600
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021103

Date: Mon, 20 Jan 2003 18:35:10 +0100
From: =?iso-8859-1?q?Bj=F6rn=20Giesler?= <giesler@ira.uka.de>
To: Nicolas Roard <nicolas@roard.com>
Cc: discuss-gnustep@gnu.org
Subject: Re: ANNOUNCE : HelpViewer 0.1
[...]
I think using HelpViewer for this doesn't seem to be such a good idea aft=
er=20
all. The NSHelpManager API has

- (NSAttributedString*) contextHelpForObject: (id)object;
- (void) removeContextHelpForObject: (id)object;
- (void) setContextHelp: (NSAttributedString*) help withObject: (id) obje=
ct;
- (BOOL) showContextHelpForObject: (id)object locationHint: (NSPoint) poi=
nt;

=2E..so everything is done via object pointers, and the returned value is=
 an=20
attributed string. I see no way to make an object pointer into an ascii t=
ag=20
that could be read from a .xlp file (is there any?), and the returned=20
attibuted string suggests that the application opens its own NSTextView.=20
Which I don't like, because it raises issues such as scrolling, navigatio=
n,=20
images etc., plus adds code bloat.

I think that this API is not one of the sparkling points of OPENSTEP. :-/=
 Any=20
ideas?

I respectfully disagree! I think that the API is just fine, as the OPENSTEP 4.2 documentation describes it. What you do there is create an RTF file for each context help item, then use the compileHelp command-line utility to compile them all into a a Help.plist file. The docs don't say, but it seems pretty clear that NSHelpManager can then just pull an NSAttributedString right out of the property list. Once you've got the NSAttributedString, you can just use -size on it, pop open a floating NSPanel with a content view that size, and then -drawInRect the string. Very quick and simple. Well, after writing the above I decided to look at the current GNUstep implementation, and I've described more or less what's already there. GNUstep does use an NSTextView, which I think is overkill, and not quite appropriate in that you can't directly put an NSAttributedString into an NSTextView. Unless I'm missing something, it looks like all that's left to do is to implement 'help' key handling in NSApplication.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]