[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Listing all top-level widgets
David Fanning <email@example.com> wrote in message
> William Thompson (firstname.lastname@example.org) writes:
> > It used to be the case that modal widgets were allowed to have child
> > However, this capability went away when RSI decided to move the /MODAL
> > from the XMANAGER call to the call to WIDGET_BASE. This severely
> > the usefulness of modal widgets, and we've had to emulate the /MODAL
> > functionality by having the modal-like widget desensitize its caller,
> > remember to resensitize it when it's done.
> I've got bad news for you, Bill. On Windows NT at least, desensitized
> *still* generate events. Although if you are lucky the desensitized look
> discourage users from clicking all your controls just to see what happens.
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'
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
When I run this program with the button de-sensitized, nothing happens when
I click on the button, e.g.
However when the button is sensitized, it generates events as expected:
IDL> whello, /sensitive