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

Home » Public Forums » archive » Widget Question
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
Widget Question [message #1496] Thu, 16 September 1993 17:09 Go to next message
scollick is currently offline  scollick
Messages: 8
Registered: November 1993
Junior Member
Here is another question that I forget to put in the last posting.
In the more current versions of IDL, a widget help window can be invoked
using '?'. But, the important part is that the "IDL>" prompt still
accepts commands. How is this done? I've written a widget interface
and would to do the same.

Post any and all answers or ideas.

Thanks much,
--Keith Scollick
Re: WIDGET QUESTION [message #2366 is a reply to message #1496] Tue, 28 June 1994 01:05 Go to previous messageGo to next message
stl is currently offline  stl
Messages: 70
Registered: February 1994
Member
In article <2ub27g$2cj@news.service.uci.edu> vshvetsk@fourier.oac.uci.edu (Victor Shvetsky) writes:
>
> I work with widgets a lot and I noticed that whenever I cover even a prt of
> the draw_widget with any other window (xterm for example) - the image will not
> be refreshed after I come back to it- HOW do I get around it?
> Thanks!
> Victor
>
Hello,

there should be a pretty simple solution for this. Most display
systems handle this automaticly, so 99% of the time you do not need to
control this from IDL. However, there are a few cases when it does
become necesary for IDL to handle backing store.

To handle this keyword RETAIN with teh command DEVICE. set retain most
likely to 2 (Make IDL perform backing store). 0 means no backing store,
and 1 means request that window system handle backing store. (I guess
I am pressuming that you have an X display) Try setting it to 1 before
assuming 2 is the only solution.

(see IDL Reference Guide, about page 3-25)

hope this helps some,

-stephen Strebel

--
Stephen C Strebel / SKI TO DIE
strebel@sma.ch / and
Swiss Meteorological Institute, Zuerich / LIVE TO TELL ABOUT IT
01 256 93 85 / (and pray for snow)
Re: WIDGET QUESTION [message #2372 is a reply to message #1496] Mon, 27 June 1994 09:38 Go to previous messageGo to next message
crdmi is currently offline  crdmi
Messages: 10
Registered: February 1994
Junior Member
In article <2ulhue$71n@news.service.uci.edu>, victor@astro2.ps.uci.edu (Victor Shvetsky (Garden)) writes:
> I am currently writing a program that uses widgets. I encountered the following
> problem:
> a=widget_base(xsize=800,ysize=800)
> b=widget_base(a, xsize=400,ysize=400)
> c=widget_draw(b, xsize=200, ysize=1000, x_scroll_size=200, y_scroll_size=200)
>
> After I realize them, and then :
> widget_control, b,/destroy
> and then once again, define b and c (c has different size now)
> IT DOES NOT WORK PROPERLY!
> COULD SOMEONE PLEASE EXAPLIN TO ME WHY?!

The IDL manual states that the [xy]size and [xy]offset parameters are
only hints, that the window system may change. This may be the cause
of the problem. You were not clear how it wasn't working, if you would
describe what happens it would be easier to diagnose.
--
Daniel M. Israel "So you better hope there's intelligent
<crdmi@vulcan.giss.nasa.gov> life somewhere out in space, 'cause there's
Goddard Institute of Space Studies bugger all down here on Earth!"
2880 Broadway, New York, NY -Monty Python's "Universe Song"
Re: WIDGET QUESTION [message #2374 is a reply to message #1496] Mon, 27 June 1994 08:58 Go to previous messageGo to next message
fskmjm is currently offline  fskmjm
Messages: 25
Registered: November 1993
Junior Member
In article <2ub27g$2cj@news.service.uci.edu> vshvetsk@fourier.oac.uci.edu (Victor Shvetsky) writes:


> I work with widgets a lot and I noticed that whenever I cover even a prt of
> the draw_widget with any other window (xterm for example) - the image will not
> be refreshed after I come back to it- HOW do I get around it?
> Thanks!
> Victor

try

widget_control,event.top,/show

after removing the top widget.
Re: WIDGET QUESTION [message #2396 is a reply to message #1496] Thu, 23 June 1994 11:35 Go to previous messageGo to next message
crdmi is currently offline  crdmi
Messages: 10
Registered: February 1994
Junior Member
In article <2ub27g$2cj@news.service.uci.edu>, vshvetsk@fourier.oac.uci.edu (Victor Shvetsky) writes:
> I work with widgets a lot and I noticed that whenever I cover even a prt of
> the draw_widget with any other window (xterm for example) - the image will not
> be refreshed after I come back to it- HOW do I get around it?

You need to set the /RETAIN keyword when you create the widget.

Check the docs, but if I remeber correctly, RETAIN=1 requests the
window manager do the retaining, and therefor is more efficent but may
not work on all window managers, and RETAIN=2 makes IDL do the
retaining.

--
Daniel M. Israel "So you better hope there's intelligent
<crdmi@vulcan.giss.nasa.gov> life somewhere out in space, 'cause there's
Goddard Institute of Space Studies bugger all down here on Earth!"
2880 Broadway, New York, NY -Monty Python's "Universe Song"
Re: postscript [message #2761 is a reply to message #2374] Tue, 20 September 1994 11:11 Go to previous messageGo to next message
dan is currently offline  dan
Messages: 27
Registered: March 1993
Junior Member
In article <fskmjm.1@puknet.puk.ac.za>, fskmjm@puknet.puk.ac.za (Mike Mathews) writes:
|> In article <1994Sep19.175952.24490@msuvx1.memphis.edu> pvemulakonda@cc.memphis.edu (PAVAN VEMULAKONDA) writes:
|>
|> > I want to convert the image on screen to a postscript file to get a
|> >printout, how can I do it on IDL.
|>
|> >pavan
|>
|>
|>
|> print = 1 ; or 0 for output to the default device
|>
|> if print then begin
|> olddevice=!d.name
|> set_plot,'ps'
|> device,/land,xsize=10,ysize=6,/inches,file='output.ps'
|> endif
|>
|> ;create your plot
|>
|> if print then begin
|> device,/close
|> set_plot,olddevice
|> endif


No, this is only if you want to regenerate the image that is on your screen. The only way
I know of to dump what is on your screen to a postcript file is to use the IDL routine
ANNOTATE after you have generated your image on the screen. ANNOTATE has a postscript option.
--
************************************************************ ***
** Dan Bergmann dbergmann@llnl.gov **
** Global Climate Research fax (510) 422-5844 **
** Lawrence Livermore National Lab human (510) 423-6765 **
Re: Widget question [message #9400 is a reply to message #1496] Mon, 30 June 1997 00:00 Go to previous messageGo to next message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Joel Hegg wrote:
> I'm trying to write my first widget, but the Reference Manual was a little
> confusing.

I sympathize completely. To say that the reference manual is "a little
confusing" is very polite.

> Can someone please explain to me how to write a widget which
> will run another IDL program once a button is pressed?

The best advice I can give you is to try the following:

(1) Check out David Fanning's example programs at
http://www.dfanning.com/documents/programs.html, e.g. PROCESS for good
examples of how to write widget programs.

(2) Get yourself a copy of "Building Graphical User Interfaces in IDL"
also by David Fanning. It's available from
Research Systems, Inc.
2995 Wilderness Place
Boulder, CO 80301
tel: 303-786-9900
fax: 303-786-9909
email: info@rsinc.com
And get a copy of David's soon-to-be-available book as soon as possible.

(3) Take a widget programming course from David.

Cheers,
Liam.
PS David pays me no commission (yet).
Re: Widget question [message #16032 is a reply to message #1496] Thu, 01 July 1999 00:00 Go to previous messageGo to next message
gabriel rodriguez ibe is currently offline  gabriel rodriguez ibe
Messages: 10
Registered: July 1999
Junior Member
If I undestand OK you are manipulating your info via a pointer, so you don't
have to
store it back anywhere, because your are really changing the original info.

If it does not seem to work you are probably not using pointers correctly.
Check this

info={...., kk:oneValue , ....}
ptrInfo= PTR_NEW(info)

Now, if you try to do

info= *ptrInfo
info.kk= newValue

it will not change the original info structure, because I'm working with a
copy of it (I should
have written " newInfo= *ptrInfo)

The correct way to do it is

(*ptrInfo).kk= newValue

Now I have modified the original info structure, I don't have to store it
anywhere.

Gabriel


Harald Frey escribi�:

> Sorry if I missed that point somewhere in the very interesting
> discussion about "Passing info and destroying widgets". I followed the
> suggestion by Liam Gumley to create my widget structure but now I have a
> problem.
>
> I have 3 levels in my widget structure, main, parent and child. What I
> do is:
>
> - Create main widget
> - Create info structure
> - store info structure in the main level base
> - start Xmanager with event handler
>
> A certain button on the main widget calls the parent process where I
> - get the info structure
> - create the parent widget
> - create a pointer to the info structure
> - store pointer in parent base
> - start second Xmanager with second event handler
>
> Now a button on the parent widget calls a process on the child level
> where I
> - get the pointer
> - get the info structure via pointer
> - manipulate the info
>
> So far everything is fine but now I want to store the manipulated info
> from the child level back into the main widget and destroy the parent
> widget. How do I do this?
>
> Harald
> hfrey@ssl.berkeley.edu
Re: Widget question [message #16142 is a reply to message #1496] Fri, 02 July 1999 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:

> As long as you remember to get/save the info structure, you won't have
> any problems. This method is a holdover from the days of handles, where
> managing info structures in this way was mandatory.

And handles were derived from unrealized base widgets,
which is what we used in the old, OLD days. How many
people here remember that? :-)

Cheers,

David

P.S. Let's just say that despite our constant bitching
and moaning, IDL does get better and better. :-)

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Widget question [message #16144 is a reply to message #1496] Fri, 02 July 1999 00:00 Go to previous messageGo to next message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Harald Frey wrote:
>
> Sorry if I missed that point somewhere in the very interesting
> discussion about "Passing info and destroying widgets". I followed the
> suggestion by Liam Gumley to create my widget structure but now I have a
> problem.
>
> I have 3 levels in my widget structure, main, parent and child. What I
> do is:
>
> - Create main widget
> - Create info structure
> - store info structure in the main level base
> - start Xmanager with event handler
>
> A certain button on the main widget calls the parent process where I
> - get the info structure
> - create the parent widget
> - create a pointer to the info structure
> - store pointer in parent base
> - start second Xmanager with second event handler
>
> Now a button on the parent widget calls a process on the child level
> where I
> - get the pointer
> - get the info structure via pointer
> - manipulate the info
>
> So far everything is fine but now I want to store the manipulated info
> from the child level back into the main widget and destroy the parent
> widget. How do I do this?

I use the following method in event handlers:

PRO MYPROG_EVENT, EVENT

;- Get the info pointer

widget_control, event.top, get_uvalue=info_ptr

;- Get the info structure

info = *info_ptr

;- Manage widget events, and change info structure...

;- Save the info structure

*info_ptr = info

END

If I create child widgets which are spawned from the top level widget,
then I pass the ID of the top level widget (event.top) to the child,
e.g.

PRO MYPROG_CHILD, TOP

;- Get the info structure

widget_control, top, get_uvalue=info_ptr

;- Get the info structure

info = *info_ptr

;- Modify items in the info structure...

;- Save the info structure

*info_ptr = info

As long as you remember to get/save the info structure, you won't have
any problems. This method is a holdover from the days of handles, where
managing info structures in this way was mandatory.

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
Re: Widget Question [message #76604 is a reply to message #1496] Thu, 09 June 2011 13:53 Go to previous message
Brian Wolven is currently offline  Brian Wolven
Messages: 94
Registered: May 2011
Member
On Thursday, June 9, 2011 4:41:49 PM UTC-4, David Fanning wrote:
> David Fanning writes:
> Live and learn, I guess. :-(

Live long enough, and re-learn. There's only so much room for storage up there, you know? ;)
Re: Widget Question [message #76605 is a reply to message #1496] Thu, 09 June 2011 13:41 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I am trying to understand one of my own programs. (I know,
> I'm embarrassed about it.)

OK, now I'm doubly embarrassed because I have to answer
my own question. It seems this is a feature of "pushbutton"
events, set with the PUSHBUTTON_EVENTS keyword on button
widgets. I'm sorry to say, I had forgotten there was
such a thing. Live and learn, I guess. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Widget Question
Next Topic: Find group_leader of a widget

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

Current Time: Wed Oct 08 19:22:39 PDT 2025

Total time taken to generate the page: 0.00444 seconds