Re: Event when Window is activated [message #41752] |
Wed, 08 December 2004 18:36 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mark Hadfield writes:
> At least that's my understanding of the original question. But I think
> it would be more sensible to renew the sub-GUI immediately the main-GUI
> value changes. The problem then is how to tell the sub-GUI of the
> change. There are many ways to do that, depending on the program
> structure, and sending an event from the mainGUI is one of them.
Indeed. In the object widget environment I often code in,
the sub-GUI would have registered "an interest" in knowing
about things that happened in the main-GUI. When something
of importance occurs, a message is sent to all interested
parties. These messages are similar to events, although
passed directly from one widget object to another.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Event when Window is activated [message #41753 is a reply to message #41752] |
Wed, 08 December 2004 15:05  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
David Fanning wrote:
> Florian Meyer writes:
>
>
>> is there a possibility to cause an event, when a GUI Window is
>> activated, i.e. one clicks on it so that it comes to the front.
>> My problem is that I have a main GUI and a subgui. When I change
>> something in the main GUI some displayed values in the subgui should
>> be adjusted. So I want to cause an event, when I look the next time at
>> the subgui, so that automatically the displayed values are renewed.
>> Is there a possibility (maybe a special keyword??) exept timer
>> events??
>
>
> I'd try:
>
> Widget_Control, subGuiWidgetID, Send_Event={whatever_event_you_like}
>
Hmmm. As I understand it, Florian wants a way of detecting when the
sub-GUI is "looked at" so that he can renew its contents at that time.
Now, several IDL widget elements can be configured to generate IDL
events in response to the actions of the user and/or the windowing
system. For example, a draw widget can be configured to generate an
event when it is exposed (by setting the EXPOSE_EVENTS keyword) or when
the mouse cursor moves over it (MOTION_EVENTS keyword) and a base widget
can be configured to generate an event when it receives or loses
keyboard focus (KBRD_FOCUS_EVENTS keyword). There are others, though I'm
not sure you can generate an event when a widget element is "looked at",
because being looked at is not a well-defined UI event.
At least that's my understanding of the original question. But I think
it would be more sensible to renew the sub-GUI immediately the main-GUI
value changes. The problem then is how to tell the sub-GUI of the
change. There are many ways to do that, depending on the program
structure, and sending an event from the mainGUI is one of them.
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|
Re: Event when Window is activated [message #41757 is a reply to message #41753] |
Wed, 08 December 2004 09:21  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Florian Meyer writes:
> is there a possibility to cause an event, when a GUI Window is
> activated, i.e. one clicks on it so that it comes to the front.
> My problem is that I have a main GUI and a subgui. When I change
> something in the main GUI some displayed values in the subgui should
> be adjusted. So I want to cause an event, when I look the next time at
> the subgui, so that automatically the displayed values are renewed.
> Is there a possibility (maybe a special keyword??) exept timer
> events??
I'd try:
Widget_Control, subGuiWidgetID, Send_Event={whatever_event_you_like}
Cheers,
David
P.S. This is pseudo code, of course. ;-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|