Widgets [message #17288] |
Thu, 30 September 1999 00:00 |
Robert LeeJoice
Messages: 3 Registered: September 1999
|
Junior Member |
|
|
Question for Widget Gurus: Can I put Widget creation items in an event
procedure? I want to be able to able to have a menu item open a new window
that consists of a table to display some data. I have put the following in
and it seems to work, but I'm concerned about how xmanager sees/doesn't see
this since the widget statements are not in the "Widget Definition file".
Is it okay and prudent to do this? I assume as long as there are no
event_procedures in the code?
PRO xdropwindsonde_view, event
; Get the info structure
Widget_Control,event.top,Get_UValue=info, /No_Copy
; Create another base for the tabluture display of data
basedataview=Widget_Base(Group_Leader=event.top,/Floating,$
Title='Dropwindsonde Data')
; Set up column labels
column_labels=strarr(12)
column_labels[0]='Pressure'
column_labels[1]='Temp'
column_labels[2]='Dew Point'
column_labels[3]='RH'
column_labels[4]='Height'
column_labels[5]='Wind Speed'
column_labels[6]='Wind Direction'
column_labels[7]='U'
column_labels[8]='V'
column_labels[9]='WZ'
column_labels[10]='Lon'
column_labels[11]='Lat'
tablevalue=fltarr(12,(*info.stormstructure).observations)
tablevalue[*,*]=310.500
tablevalue[0,*]=((*info.stormstructure).p)
tablevalue[1,*]=(*info.stormstructure).t
tablevalue[2,*]=(*info.stormstructure).dp
tablevalue[3,*]=(*info.stormstructure).rh
tablevalue[4,*]=(*info.stormstructure).height
tablevalue[5,*]=(*info.stormstructure).ws
tablevalue[6,*]=(*info.stormstructure).wd
tablevalue[7,*]=(*info.stormstructure).u
tablevalue[8,*]=(*info.stormstructure).v
tablevalue[9,*]=(*info.stormstructure).wz
tablevalue[10,*]=(*info.stormstructure).lata
tablevalue[11,*]=(*info.stormstructure).lono
; Put the table on the secondary base
table=Widget_Table(basedataview,Column_Labels=column_labels, /Scroll,$
Value=tablevalue,X_Scroll_Size=12,Y_Scroll_Size=20)
Widget_Control,basedataview,/Realize
Widget_Control,event.top,Set_UValue=info, /No_Copy
END
;-------------------------
In the meantime I'll be rereading Chapters 13,14,15 from D. Fanning!
TIA
Robert LeeJoice
Colorado State University, Graduate Student
leejoice@email.msn.com
leejoice@typhoon.atmos.colostate.edu
|
|
|