Re: Hiding a widget [message #10631] |
Fri, 02 January 1998 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
David Fanning wrote:
>
> Dale Gary (dgary@umbra.njit.edu) writes:
>
>> I was experimenting with the MAP keyword in widget programming and it
>> did not do quite
>> what I wanted. Perhaps someone can tell me if there is a better way. I
>> create a widget heirarchy,
>> then in response to a menu event I "hide" one of the widgets by using
>> WIDGET_CONTROL,widgetID,MAP=0
>> and the widget gratifyingly disappears. Unfortunately, I expected my
>> dynamically sized base widget,
>> which holds the hidden widget, to now shrink but instead there is just a
>> big gaping hole where the
>> hidden widget is. In other words, the sizing of the base widget still
>> takes into account the hidden
>> widget.
>>
>> What I want, I guess, is to remove the widget entirely from the
>> heirarchy, but I cannot find information
>> on how to do that. Does anyone have a simple technique short of
>> rebuilding the entire heirarchy from
>> scratch?
Don't know if this will be useful for your application, but you can
overlay widgets and groups of widgets. A good example of this is the
IDL procedure $IDL_DIR/lib/SLICER.PRO. The section that illustrates
this begins with:
junk = WIDGET_BASE(lbase, /FRAME, /COLUMN)
mode_base = WIDGET_BASE(junk) ;For the mode dependent bases
for i=0,nmodes-1 do $
if i ne 2 then $
sl.mode_bases[i] = WIDGET_BASE(mode_base, uvalue=0L, /COLUMN)
and then for each widget group that you want as an overlay you say:
parent = sl.mode_bases[0] ; slices mode
and then you buid this widget group using PARENT as the widget base ID.
At the very least, you could make a widget "disappear" by overlaying
it with something else, maybe a blank label widget.
However, if you are just trying to make the widget unavailable to the
user, then you should follow David Fanning's advice and use the
/SENSITIVE and SENSITIVE=0 keyword instead.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|