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

Home » Public Forums » archive » problem with two tlb widget program
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
problem with two tlb widget program [message #36882] Wed, 05 November 2003 14:06
lius02 is currently offline  lius02
Messages: 6
Registered: November 2003
Junior Member
I have a problem with a two tlb widget program. What I want is when
the user press enter on the cw_field widget in the second tlb, the
plot on the second tlb should be refreshed. But the program runs very
weird, when user press the enter, it just waiting, only after you move
the mouse to the draw widget on the first tlb, it begin to refresh the
draw widget on the second tlb. Following are the codes, any
suggestions are highly appreciated.

;definition
tlb=widget_base(title='MetabROI', $ ;top level base
/row, $
mbar=menubar)

;draw widget on the first tlb
image_base=widget_base(tlb, /row)
image_draw=widget_draw(image_base, $ scr_xsize=1024, $
scr_ysize=1024, $
button_event=1, $
motion_event=1, $
event_pro='roi')
;second tlb
tlb1 = Widget_Base(Group_Leader=tlb, $
column, $
/TLB_KILL_REQUEST_EVENTS, $
event_pro = "tlb1_iconify", $
Title='Average Spectroscopy')

specwindow_base=widget_base(tlb1, $
/row)
specdraw = Widget_Draw(specwindow_base, $
XSize=1024, $
YSize=632 $
)
specbutton_base=widget_base(tlb1, $
/row, $
event_pro = 'range' $
)
startpoint = cw_field(specbutton_base, $
/return_events, $
title = 'START POINT', $
xsize = 8 $
)

endpoint = cw_field(specbutton_base, $
/return_events, $
title = 'END POINT', $
xsize = 8 $
)

;codes realize second tlb
widget_control, event.top, get_uvalue = pinfo
widget_control, (*pinfo).tlb1, /realize
widget_control, (*pinfo).specdraw, get_value=specdraw_id
(*pinfo).specdraw_id = specdraw_id

widget_control, (*pinfo).tlb1, set_uvalue = pinfo

;second tlb event block codes
widget_control, event.top, get_uvalue = pinfo
widget_control, (*pinfo).startpoint, get_value = startpoint
startpoint = round(fix(startpoint))

widget_control, (*pinfo).endpoint, get_value = endpoint
endpoint = round(fix(endpoint))

wset, (*pinfo).specdraw_id
erase
wshow, (*pinfo).specdraw_id

;draw it
plot, *(*pinfo).avg_spec, $
xrange = [startpoint, endpoint], $
Xstyle = 1, $
/device
[Message index]
 
Read Message
Previous Topic: Automatic Updates to Coyote's Guide
Next Topic: What to name a class definition file?

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

Current Time: Thu Oct 09 11:03:43 PDT 2025

Total time taken to generate the page: 1.28069 seconds