common variables between widgets [message #32699] |
Tue, 29 October 2002 14:57  |
boehmholger
Messages: 2 Registered: October 2002
|
Junior Member |
|
|
Hi there,
I�m a beginner to IDL with some knowledge of VB and C++.
Presently, I try to catch on to widget-programming and now encounter
some problems regarding the scope of variables.
My problem:
I want to load an image file by pushing a button and then manipulate
the image data using a slider. How can I allow the slider-procedure to
"see" the image data as loaded in the button-procedure?
Looking forward to your tips,
Holger
|
|
|
Re: common variables between widgets [message #32765 is a reply to message #32699] |
Fri, 01 November 2002 09:20  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Holger Boehm wrote:
> Hi there,
>
> I?m a beginner to IDL with some knowledge of VB and C++.
> Presently, I try to catch on to widget-programming and now encounter
> some problems regarding the scope of variables.
>
> My problem:
> I want to load an image file by pushing a button and then manipulate
> the image data using a slider. How can I allow the slider-procedure to
> "see" the image data as loaded in the button-procedure?
>
> Looking forward to your tips,
> Holger
Dear Holger,
here is a small example,
if you like to have more examples and especially in German you can have
a look at
http://www.fz-juelich.de/vislab/software/idl_samples/IDL-Bei spielsammlung.html
This is the examples library from our new IDL book written in German.
Title:
Praxisbezogene IDL Programmierung
Authors:
M. Busch, R.Bauer, H.Heer, M.Wagener
ISBN: 3-89336-308-4, EUR 44,00
Further information:
http://www.fz-juelich.de/zb/text/publikation/infotechnik.htm l
PRO small_widget_event,event
name=WIDGET_INFO(event.id,/UNAME)
PRINT,name
WIDGET_CONTROL,event.top,get_uvalue=data
CASE name OF
'QUIT': WIDGET_CONTROL,event.top,/destroy
'START': BEGIN
; *data=DIST(256)
WIDGET_CONTROL,get_value=wid,$
WIDGET_INFO(event.top,find_by_uname='DRAW')
WSET,wid
TVSCL,*data
END
'SLIDER' :BEGIN
WIDGET_CONTROL,event.id,get_value=value
TVSCL,*data<value
END
ELSE:
ENDCASE
END
PRO small_widget
data=PTR_NEW(DIST(256))
base=WIDGET_BASE(col=2,title='variables between widgets',$
uvalue=data)
id=WIDGET_BUTTON(base,value='START',uname='START')
id=WIDGET_BUTTON(base,value='QUIT',uname='QUIT')
base2=WIDGET_BASE(base,row=1, $
title='variables between widgets')
id=WIDGET_DRAW(base2,retain=2,xsize=256,ysize=256,$
uname='DRAW')
id=WIDGET_SLIDER(base2,/vertical,min=1,$
max=255,value=255,uname='SLIDER')
WIDGET_CONTROL,/realize,base
XMANAGER,'small_widget',base
PTR_FREE,data
END
--
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
|
|
|