Re: objets solarsoft [message #43102 is a reply to message #43101] |
Wed, 16 March 2005 05:54   |
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?
>
|
|
|