Re: Realizing a widget only once [message #39003] |
Thu, 15 April 2004 00:56 |
cabrera
Messages: 4 Registered: July 2003
|
Junior Member |
|
|
What I use is XREGISTERED. Before create the widget you can use it
IF ( XREGISTERED('widget_name') NE 0 ) THEN RETURN ;already launched
WIDGET_CONTROL, fbase, /REALIZE
XMANAGER, 'widget_name', fbase, GROUP_LEADER=group
Juan
|
|
|
Re: Realizing a widget only once [message #39004 is a reply to message #39003] |
Thu, 15 April 2004 00:52  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Ahammer Helmut wrote:
> Reimar Bauer <R.Bauer@fz-juelich.de> wrote in message
> news:<c5k8qh$5iq1$1@zam602.zam.kfa-juelich.de>...
>> Ahammer Helmut wrote:
>>
>>> Is there any possibility to open and realize a widget only once, even
>>> it is called several times? The widget is mainly a draw widget for
>>> images and is called from an other program or widget like this:
>>>
>>> DISPLAYIMAGE, Image = Image
>>>
>>> The first call, or if there is no such widget present, should really
>>> realize the widget. The second call should not realize a second
>>> widget, but only put the new data (image) to the draw widget.
>>> I think the /OVERPLOT keyword for IIMAGE does equivalently what I
>>> want, but I can`t follow the itools syntax for this feature.
>>>
>>> Thank you for every input,
>>> Helmut Ahammer
>>
>> Dear Helmut,
>>
>> the only thing you need to know is the id of the draw widget. You do not
>> need to copy this information elsewhere. You must only ask for it.
>>
>> If the draw widget is already realized then you can get the id of the
>> widget by it's uname.
>> id=WIDGET_INFO(event.top,FIND_BY_UNAME='DRAW_WINDOW')
>>
>>
>> How to use uname you could see here:
>> http://www.fz-juelich.de/vislab/software/idl_samples/Widgets /Oberflaechen
>> wid5.pro
>>
>>
>> Further examples you'll find at
>> http://www.fz-juelich.de/vislab/software/idl_samples
>> IDL-Beispielsammlung.html
>>
>> cheers
>>
>> Reimar
>
>
> Thank you very much,
>
> my display widget (a tlb widget) works already with the drawID and
> setting of the UVALUE for the event handling in a similar way as is
> done in your widget example (Oberflᅵchen). But how is this done
> between two tlb widgets? Perhaps I can store the drawID into a global
> variable or pointer and put the new image from the second tlb direct
> into the draw widget of the display widget.
>
> Thanks, Helmut
Dear Helmut,
you should have a look at the group_leader keyword. By this you could share
all information about the widget hierarchy and all unames from one base to
an other.
cheers
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|
Re: Realizing a widget only once [message #39006 is a reply to message #39004] |
Wed, 14 April 2004 23:36  |
helaha
Messages: 26 Registered: March 2004
|
Junior Member |
|
|
Reimar Bauer <R.Bauer@fz-juelich.de> wrote in message news:<c5k8qh$5iq1$1@zam602.zam.kfa-juelich.de>...
> Ahammer Helmut wrote:
>
>> Is there any possibility to open and realize a widget only once, even
>> it is called several times? The widget is mainly a draw widget for
>> images and is called from an other program or widget like this:
>>
>> DISPLAYIMAGE, Image = Image
>>
>> The first call, or if there is no such widget present, should really
>> realize the widget. The second call should not realize a second
>> widget, but only put the new data (image) to the draw widget.
>> I think the /OVERPLOT keyword for IIMAGE does equivalently what I
>> want, but I can`t follow the itools syntax for this feature.
>>
>> Thank you for every input,
>> Helmut Ahammer
>
> Dear Helmut,
>
> the only thing you need to know is the id of the draw widget. You do not
> need to copy this information elsewhere. You must only ask for it.
>
> If the draw widget is already realized then you can get the id of the
> widget by it's uname.
> id=WIDGET_INFO(event.top,FIND_BY_UNAME='DRAW_WINDOW')
>
>
> How to use uname you could see here:
> http://www.fz-juelich.de/vislab/software/idl_samples/Widgets /Oberflaechen
> wid5.pro
>
>
> Further examples you'll find at
> http://www.fz-juelich.de/vislab/software/idl_samples
> IDL-Beispielsammlung.html
>
> cheers
>
> Reimar
Thank you very much,
my display widget (a tlb widget) works already with the drawID and
setting of the UVALUE for the event handling in a similar way as is
done in your widget example (Oberfl�chen). But how is this done
between two tlb widgets? Perhaps I can store the drawID into a global
variable or pointer and put the new image from the second tlb direct
into the draw widget of the display widget.
Thanks, Helmut
|
|
|
Re: Realizing a widget only once [message #39008 is a reply to message #39006] |
Wed, 14 April 2004 14:14  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Ahammer Helmut wrote:
> Is there any possibility to open and realize a widget only once, even
> it is called several times? The widget is mainly a draw widget for
> images and is called from an other program or widget like this:
>
> DISPLAYIMAGE, Image = Image
>
> The first call, or if there is no such widget present, should really
> realize the widget. The second call should not realize a second
> widget, but only put the new data (image) to the draw widget.
> I think the /OVERPLOT keyword for IIMAGE does equivalently what I
> want, but I can`t follow the itools syntax for this feature.
>
> Thank you for every input,
> Helmut Ahammer
Dear Helmut,
the only thing you need to know is the id of the draw widget. You do not
need to copy this information elsewhere. You must only ask for it.
If the draw widget is already realized then you can get the id of the
widget by it's uname.
id=WIDGET_INFO(event.top,FIND_BY_UNAME='DRAW_WINDOW')
How to use uname you could see here:
http://www.fz-juelich.de/vislab/software/idl_samples/Widgets /Oberflaechen
wid5.pro
Further examples you'll find at
http://www.fz-juelich.de/vislab/software/idl_samples
IDL-Beispielsammlung.html
cheers
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|
Re: Realizing a widget only once [message #39014 is a reply to message #39008] |
Wed, 14 April 2004 08:32  |
Pavel Romashkin
Messages: 166 Registered: April 1999
|
Senior Member |
|
|
You would have to somehow record the fact that the widget has been
created. The simplest place for doing this is a Common block with a
specific name, where you can set a flag. There are alternatives that
have been discussed here before; a Google groups search for IDL global
variable would turn up quite a variety of answers.
Good luck,
Pavel
Ahammer Helmut wrote:
>
> Is there any possibility to open and realize a widget only once, even
> it is called several times? The widget is mainly a draw widget for
> images and is called from an other program or widget like this:
>
> DISPLAYIMAGE, Image = Image
>
> The first call, or if there is no such widget present, should really
> realize the widget. The second call should not realize a second
> widget, but only put the new data (image) to the draw widget.
> I think the /OVERPLOT keyword for IIMAGE does equivalently what I
> want, but I can`t follow the itools syntax for this feature.
>
> Thank you for every input,
> Helmut Ahammer
|
|
|