Re: How to define non-widget event.ids ? [message #29490] |
Mon, 25 February 2002 08:59 |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Streun Andreas wrote:
> In an event handler, the different event.ids are usually
> widget identifiers. However, when programming a loop
> as an event chain I send pseudo-events to event.ids
> which have no corresponding widget (e.g. a virtual
> "next step" button which is never used by man).
>
> The only way I yet know to realize that, is to define
> small, empty, inactive buttons in the GUI, only in
> order to get valid event.ids.
I'm not sure I understand why you have to send events in this instance.
If there's no real widget associated with the widget id, why not just
pass the 'events' to an ordinary function for processing?
> Unfortunately, this creates "pimples" in the GUI...
If you don't need them for their visible appearance, perhaps you could
attach them to a base that you never bother realizing? it would be used
solely as a place to contain widgets used for this purpose.
|
|
|
Re: How to define non-widget event.ids ? [message #29491 is a reply to message #29490] |
Mon, 25 February 2002 08:31  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Streun Andreas (andreas.streun@psi.ch) writes:
> In an event handler, the different event.ids are usually
> widget identifiers. However, when programming a loop
> as an event chain I send pseudo-events to event.ids
> which have no corresponding widget (e.g. a virtual
> "next step" button which is never used by man).
>
> The only way I yet know to realize that, is to define
> small, empty, inactive buttons in the GUI, only in
> order to get valid event.ids.
>
> Unfortunately, this creates "pimples" in the GUI...
>
> Probably one of the experts immediately can tell how
> to solve this [cosmetic] problem:
> Is it possible to have user-defined, non-widget event.ids?
Oh, I don't think it is possible to write a widget
program without one or two of those homely widgets
who just stand around begging to be asked to the dance.
Label widgets come immediately to mind, since they don't
even know how to dance, normally. But their second
cousins, the base widgets, will also due in a pinch.
Just attach an event handler to one of them and dial
them as often as you like. They'll be glad you called,
and you won't have to worry about widget ache ever
again.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|