comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Help with widgets code
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Help with widgets code [message #648] Wed, 09 December 1992 00:35
hm342st is currently offline  hm342st
Messages: 2
Registered: September 1992
Junior Member
> PAS> Now, what I'm faced with is a lack of communication between the
> PAS> two proc's. For instance, if I have displayed my fabulous image
> PAS> into the draw widget, and then hand off control to the xmanager,
> PAS> but then decide that I want a button (already defined) to
> PAS> initiate a redraw of the image but using the log of the data, how
> PAS> do I tell the event proc what the original image array was?
> PAS> There appears to be no way to pass this information across the
> PAS> xmanager call?

> You need to use the UVALUE of one of the widgets; the top level widget
> works best.

> Before XMANAGER call:

> WIDGET_CONTROL,SET_UVALUE=mydata,topwidget



> In event handler:

> WIDGET_CONTROL,GET_UVALUE=mydata,event.top



> mydata can be an anonymous structure, an array, anything you want.

> A few hints:

> 1. Don't use common blocks in widgets ever: you pay for them later
> if you want to support multiple instances of any particular
> widget. IDL sample widgets (e.g. animate,slicer) suffer from this
> problem.


This is not completely true concerning the common blocks. The first time
using the widget set I was misleaded by the examples and used UVALUE just
as an identifier. No idea assigning 'real' data to it.

I found a solution using common blocks. They are not as bad as it seems.
It really depends on the data connected to them! I used list structures
which are fairly easily to handle. Using e.g. the base_widget as a key
in the list, it was possible to do all the things I, of course, better
should have done using a more comlex UVALUE (multiple instances).

Nowadays I am using UVALUEs, but I could not get rid of the lists, either.
I think, Vers. 3.0 with its possiblity to find out some relations between
widgtes will remove further lists.



- J"org


Reply-To: joerg.plewe@mpi-dortmund.mpg.de
Re: Help with widgets code [message #649 is a reply to message #648] Tue, 08 December 1992 13:29 Go to previous message
mberkley is currently offline  mberkley
Messages: 5
Registered: December 1992
Junior Member
> On Mon, 7 Dec 1992 19:49:25 GMT, scowen@wfpc3.la.asu.edu (Paul A. Scowen) said:

PAS> Now, what I'm faced with is a lack of communication between the
PAS> two proc's. For instance, if I have displayed my fabulous image
PAS> into the draw widget, and then hand off control to the xmanager,
PAS> but then decide that I want a button (already defined) to
PAS> initiate a redraw of the image but using the log of the data, how
PAS> do I tell the event proc what the original image array was?
PAS> There appears to be no way to pass this information across the
PAS> xmanager call?

You need to use the UVALUE of one of the widgets; the top level widget
works best.

Before XMANAGER call:

WIDGET_CONTROL,SET_UVALUE=mydata,topwidget



In event handler:

WIDGET_CONTROL,GET_UVALUE=mydata,event.top



mydata can be an anonymous structure, an array, anything you want.

A few hints:

1. Don't use common blocks in widgets ever: you pay for them later
if you want to support multiple instances of any particular
widget. IDL sample widgets (e.g. animate,slicer) suffer from this
problem.

2. Remember that the uvalue is a copy of the original data, not a
pointer to it. This is usually not a problem, but I had some
problems with passing huge structs around because I could only
pass a copy and not a pointer.


Mike Berkley
mberkley@sirius.UVic.CA
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Complex SVD needed
Next Topic: Re: Complex SVD needed

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:33:57 PDT 2025

Total time taken to generate the page: 1.28087 seconds