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

Home » Public Forums » archive » Re: objets solarsoft
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: objets solarsoft [message #43101] Wed, 16 March 2005 07:04
hernan is currently offline  hernan
Messages: 11
Registered: March 2005
Junior Member
Thank Haje.
Re: objets solarsoft [message #43102 is a reply to message #43101] Wed, 16 March 2005 05:54 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Hernan,
David means "EVENT_HANDLER", he just forgot the "L". Tip: Type "?" to get
the online help!!!

Haje


"hernan" <tmil_pe@yahoo.com> wrote in message
news:1110980870.637746.223000@l41g2000cwc.googlegroups.com.. .
>
> David Fanning wrote:
>> hernan writes:
>>
>>> =BFcomo puedo insertar esta linea (ver
>>> http://orpheus.nascom.nasa.gov/~zarro/idl/objects/objects.ht ml)
> dentro
>>> de un widget?.
>>>
>>> IDL> file=3D'mdi_maglc_re_20040310_2102.fts'
>>> IDL> mobj=3Dobj_new('mdi') ;-- create an
> MDI
>>> object
>>> IDL> mobj->read,file ;-- read MDI file
>>> IDL> mobj->plot ;-- plot MDI image
>>>
>>> Gracias
>>
>
>
>> Something like this:
>>
>> Pro Example_Event, event
>>
>> ; Is this a selection event?
>> IF event.select NE 1 THEN RETURN
>>
>> ; Get the name of a FITS file to open.
>> filename = Dialog_Pickfile('mdi_maglc_re_20040310_2102.fts', $
>> Filter='.fits')
>> IF filename EQ "" THEN RETURN
>>
>>
>> ; Get the info structure.
>> Widget_Control, event.top, Get_UValue=info
>>
>> ; Read the file.
>> info.mobj -> Read, filename
>>
>> ; Display the plot in draw widget.
>> Widget_Control, info.draw, Get_Value=wid
>> WSet, wid
>> info.mobj -> Plot
>>
>> END
>>
>>
>> Pro Example_Cleanup, tlb
>>
>> Widget_Control, tlb, Get_UValue=info
>> Obj_Destroy, info.mobj
>>
>> END
>>
>> Pro Example
>>
>> tlb = Widget_Base(/Column)
>> button = Widget_Button(tlb, Value='Select File to Plot')
>> draw = Widget_Draw(tlb, XSize=400, YSize=400)
>>
>> info = {draw:draw, mobj:Obj_New('mdi')}
>> Widget_Control, tlb, /Realize, Set_UValue=info
>>
>> Xmanager, 'example', tlb, /No_Block, $
>> Event_Hander='Example_Event', $
>> Cleanup='Example_Cleanup'
>> END
>>
>> Cheers,
>>
>> David
>>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Hello David
> Thank you very much for your help. In my PC, this message have
> appeared:
>
> % Keyword EVENT_HANDER not allowed in call to: XMANAGER
> % Execution halted at: EXAMPLE 50
> C:\RSI\IDL60\hernan\example.pro
> % $MAIN$
>
> but deleting this line, the program works correctly. Do you know if
> this happen because I am using version 6.0?. Or there may be another
> reason?
>
Re: objets solarsoft [message #43103 is a reply to message #43102] Wed, 16 March 2005 05:47 Go to previous message
hernan is currently offline  hernan
Messages: 11
Registered: March 2005
Junior Member
David Fanning wrote:
> hernan writes:
>
>> =BFcomo puedo insertar esta linea (ver
>> http://orpheus.nascom.nasa.gov/~zarro/idl/objects/objects.ht ml)
dentro
>> de un widget?.
>>
>> IDL> file=3D'mdi_maglc_re_20040310_2102.fts'
>> IDL> mobj=3Dobj_new('mdi') ;-- create an
MDI
>> object
>> IDL> mobj->read,file ;-- read MDI file
>> IDL> mobj->plot ;-- plot MDI image
>>
>> Gracias
>


> Something like this:
>
> Pro Example_Event, event
>
> ; Is this a selection event?
> IF event.select NE 1 THEN RETURN
>
> ; Get the name of a FITS file to open.
> filename = Dialog_Pickfile('mdi_maglc_re_20040310_2102.fts', $
> Filter='.fits')
> IF filename EQ "" THEN RETURN
>
>
> ; Get the info structure.
> Widget_Control, event.top, Get_UValue=info
>
> ; Read the file.
> info.mobj -> Read, filename
>
> ; Display the plot in draw widget.
> Widget_Control, info.draw, Get_Value=wid
> WSet, wid
> info.mobj -> Plot
>
> END
>
>
> Pro Example_Cleanup, tlb
>
> Widget_Control, tlb, Get_UValue=info
> Obj_Destroy, info.mobj
>
> END
>
> Pro Example
>
> tlb = Widget_Base(/Column)
> button = Widget_Button(tlb, Value='Select File to Plot')
> draw = Widget_Draw(tlb, XSize=400, YSize=400)
>
> info = {draw:draw, mobj:Obj_New('mdi')}
> Widget_Control, tlb, /Realize, Set_UValue=info
>
> Xmanager, 'example', tlb, /No_Block, $
> Event_Hander='Example_Event', $
> Cleanup='Example_Cleanup'
> END
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/

Hello David
Thank you very much for your help. In my PC, this message have
appeared:

% Keyword EVENT_HANDER not allowed in call to: XMANAGER
% Execution halted at: EXAMPLE 50
C:\RSI\IDL60\hernan\example.pro
% $MAIN$

but deleting this line, the program works correctly. Do you know if
this happen because I am using version 6.0?. Or there may be another
reason?
Re: objets solarsoft [message #43113 is a reply to message #43103] Tue, 15 March 2005 11:17 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
hernan writes:

> =BFcomo puedo insertar esta linea (ver
> http://orpheus.nascom.nasa.gov/~zarro/idl/objects/objects.ht ml) dentro
> de un widget?.
>
> IDL> file=3D'mdi_maglc_re_20040310_2102.fts'
> IDL> mobj=3Dobj_new('mdi') ;-- create an MDI
> object
> IDL> mobj->read,file ;-- read MDI file
> IDL> mobj->plot ;-- plot MDI image
>
> Gracias

Something like this:

Pro Example_Event, event

; Is this a selection event?
IF event.select NE 1 THEN RETURN

; Get the name of a FITS file to open.
filename = Dialog_Pickfile('mdi_maglc_re_20040310_2102.fts', $
Filter='.fits')
IF filename EQ "" THEN RETURN


; Get the info structure.
Widget_Control, event.top, Get_UValue=info

; Read the file.
info.mobj -> Read, filename

; Display the plot in draw widget.
Widget_Control, info.draw, Get_Value=wid
WSet, wid
info.mobj -> Plot

END


Pro Example_Cleanup, tlb

Widget_Control, tlb, Get_UValue=info
Obj_Destroy, info.mobj

END

Pro Example

tlb = Widget_Base(/Column)
button = Widget_Button(tlb, Value='Select File to Plot')
draw = Widget_Draw(tlb, XSize=400, YSize=400)

info = {draw:draw, mobj:Obj_New('mdi')}
Widget_Control, tlb, /Realize, Set_UValue=info

Xmanager, 'example', tlb, /No_Block, $
Event_Hander='Example_Event', $
Cleanup='Example_Cleanup'
END

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: creating documentation file
Next Topic: reflection function

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

Current Time: Fri Oct 10 10:51:38 PDT 2025

Total time taken to generate the page: 0.87915 seconds