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

Home » Public Forums » archive » Loading picture into compound widget
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
Loading picture into compound widget [message #31881] Tue, 27 August 2002 02:15
Evgeny Turchin is currently offline  Evgeny Turchin
Messages: 12
Registered: August 2002
Junior Member
Hello, All !
I want the picture which is opened when choosing "Open" item
in "File" menu to be loaded into the draw widget but in my program
it is loaded into a separate window. What should I change in my programs?
Thanks in advance. I'm sorry for bothering the readers of the newsgroup
with
such simple thing.

Best regards, Evgeny Turchin.


===================File simple.pro============================

pro base_event, Event

wWidget = Event.top

case Event.id of

Widget_Info(wWidget, FIND_BY_UNAME='menuFileOpen'): begin
if( Tag_Names(Event, /STRUCTURE_NAME) eq 'WIDGET_BUTTON' )then $
OnOpen, Event
end
Widget_Info(wWidget, FIND_BY_UNAME='menuFileExit'): begin
if( Tag_Names(Event, /STRUCTURE_NAME) eq 'WIDGET_BUTTON' )then $
OnExit, Event
end
endcase

end

pro base, GROUP_LEADER=wGroup, _EXTRA=_VWBExtra_

Resolve_Routine, 'simple_eventcb', /COMPILE_FULL_FILE

base = Widget_Base( GROUP_LEADER=wGroup, UNAME='base' $
,TITLE='My application' ,SPACE=3 ,XPAD=3 ,YPAD=3 $
,MBAR=WID_BASE_0_MBAR, /COLUMN)

drawViewer = Widget_Draw(base, UNAME='drawViewer' $
,SCR_XSIZE=400,SCR_YSIZE=400)

menuFile = Widget_Button(WID_BASE_0_MBAR, UNAME='menuFile' ,/MENU $
,VALUE='File')

menuFileOpen = Widget_Button(menuFile, UNAME='menuFileOpen' $
,VALUE='Open')

menuFileExit = Widget_Button(menuFile, UNAME='menuFileExit' $
,/SEPARATOR ,VALUE='Exit')

Widget_Control, /REALIZE, base
WIDGET_CONTROL, drawViewer, GET_VALUE = index
WSET, index
XManager, 'base', base, /NO_BLOCK

end
;
; Empty stub procedure used for autoloading.
;
pro simple, GROUP_LEADER=wGroup, _EXTRA=_VWBExtra_
base, GROUP_LEADER=wGroup, _EXTRA=_VWBExtra_
end
===================End of file simple.pro============================



================== File simple_eventcb.pro =================================

; Event Callback Procedures

pro OnOpen, Event
ImageIsRead=DIALOG_READ_IMAGE(DIALOG_PARENT=Event.top, FILE=FileName, $
FILTER_TYPE='.tif, .tiff', IMAGE=PhotoArray, TITLE='Choose the photo
file')
IF (ImageIsRead EQ 1) THEN TVSCL, PhotoArray
end


pro OnExit, Event
Widget_Control, Event.Top, /DESTROY ; Destroy the widget
end

pro simple_eventcb
;COMPILE_OPT hidden, idl2
end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Saving Plot Products
Next Topic: Convert_Coords for map gives many 'error messages'?

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

Current Time: Sat Oct 11 01:07:30 PDT 2025

Total time taken to generate the page: 1.68054 seconds