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

Re: Listing all top-level widgets



David Fanning <davidf@dfanning.com> wrote in message
MPG.12fa2fc4c60fed3989a01@news.frii.com">news:MPG.12fa2fc4c60fed3989a01@news.frii.com...
> William Thompson (thompson@orpheus.nascom.nasa.gov) writes:
>
> > It used to be the case that modal widgets were allowed to have child
widgets.
> > However, this capability went away when RSI decided to move the /MODAL
keyword
> > from the XMANAGER call to the call to WIDGET_BASE.  This severely
restricted
> > the usefulness of modal widgets, and we've had to emulate the /MODAL
> > functionality by having the modal-like widget desensitize its caller,
and then
> > remember to resensitize it when it's done.
>
> I've got bad news for you, Bill. On Windows NT at least, desensitized
widgets
> *still* generate events. Although if you are lucky the desensitized look
will
> discourage users from clicking all your controls just to see what happens.
:-)

Strange...
I just tried the following program in IDL 5.3 under Windows 98:

PRO WHELLO_EVENT, EVENT
widget_control, event.id, get_uvalue=uvalue
if (uvalue eq 'OK') then print, 'OK event detected'
END

PRO WHELLO, SENSITIVE=SENSITIVE

;- Create widgets
base = widget_base(/column, xoffset=300, yoffset=300)
label = widget_label(base, value='Hello world')
button = widget_button(base, value='OK', uvalue='OK')
widget_control, base, /realize
widget_control, button, sensitive=keyword_set(sensitive)

;- Start event manager
xmanager, 'whello', base

END

When I run this program with the button de-sensitized, nothing happens when
I click on the button, e.g.

IDL> whello

However when the button is sensitized, it generates events as expected:

IDL> whello, /sensitive

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley