Widget Question [message #1496] |
Thu, 16 September 1993 17:09  |
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 #2372 is a reply to message #1496] |
Mon, 27 June 1994 09:38   |
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: postscript [message #2761 is a reply to message #2374] |
Tue, 20 September 1994 11:11   |
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 #16032 is a reply to message #1496] |
Thu, 01 July 1999 00:00   |
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 #16144 is a reply to message #1496] |
Fri, 02 July 1999 00:00   |
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  |
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  |
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.")
|
|
|