Re: "Help" in Widget Programs [message #2321] |
Thu, 09 June 1994 06:13 |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Daniel M. Israel (crdmi@vulcan.giss.nasa.gov) wrote:
> Has anyone written any widget programs with context sensitive pop-up
> help? I would like to do this, but I can't think of any method that is
> not extremely clumsy. Any suggestions?
Here's an idea: Suppose you had a widget button marked "Help" which could be
either on or off. Then, in your event handler routine when you process a
widget event it would look to see if this button was on. If it was, then a
context-sensitive help screen would pop up; if not, then the button would just
do what it was supposed to do.
Conceptually simple, but somewhat tedious since you'd have to put this
IF..THEN..ELSE structure in for each possible widget event.
Bill Thompson
|
|
|
Re: "Help" in Widget Programs [message #2331 is a reply to message #2321] |
Wed, 08 June 1994 14:40  |
landers
Messages: 45 Registered: May 1993
|
Member |
|
|
Daniel M. Israel (crdmi@vulcan.giss.nasa.gov) wrote:
|>
|> Has anyone written any widget programs with context sensitive pop-up
|> help? I would like to do this, but I can't think of any method that is
|> not extremely clumsy. Any suggestions?
I haven't done this, and I am not familiar with IDL widgets (just WAVE)...
But it seems that you could create a 'help' button whose callback would:
- set a global (common block) 'do_help' flag
- maybe change the cursor to a ? (if you could reasonably do that
'recursively' through all your widgets)
Then write a widget_help() function that would check the do_help flag, and
pop up the help text, and reset the flag.
It would return the flag (0 if not helping, 1 if helping), so each of your
callbacks would do:
pro callback_whatever, etc
if widget_help( 'help_file_for_this_widget.txt' ) then return
;... regular callback stuff....
end
This may not pass the 'clumsy test', but seems a reasonable starting point.
It only adds one line of code to the callback programs, but you may need to
create callbacks for widgets that wouldn't normally do anything (like display
widgets or whatever).
Just what came to mind.....
;Dave
|
|
|
Re: "Help" in Widget Programs [message #2342 is a reply to message #2331] |
Wed, 08 June 1994 02:38  |
sjt
Messages: 72 Registered: November 1993
|
Member |
|
|
Daniel M. Israel (crdmi@vulcan.giss.nasa.gov) wrote:
: Has anyone written any widget programs with context sensitive pop-up
: help? I would like to do this, but I can't think of any method that is
: not extremely clumsy. Any suggestions?
: --
: Daniel M. Israel "So you better hope there's intellegent
: <crdmi@vulcan.giss.nasa.gov> life somewhere out in space, 'cause there's
: Goddard Institute of Space Studies bugger all down here on Earth!"
: 2880 Broadway, New York, NY -Monty Python's "Universe Song"
I agree, this is a problem. It would be nice if widget events were returned
for all mouse buttons (as they are in draw widgets), then it would be possible
to have (say) left button to perform action and middle button for help. Perhaps
RSI could consider sending events from all buttons in a future release and
adding an EVENT.BUTTON to the EVENT structure for all widget types.
--
James Tappin, School of Physics & Space Research
University of Birmingham
sjt@xun8.sr.bham.ac.uk
"If all else fails--read the instructions!"
O__
-- \/`
|
|
|