Update text widget [message #65247] |
Thu, 19 February 2009 01:25 |
titan
Messages: 59 Registered: March 2006
|
Member |
|
|
Hi all,
I'm trying to write my own first widget but probably I'm missing
something about the event handler.
I would like to create a widget text with 4 rows. these rows are
created as insensitive and I would like to make them sensitive when
each of these processes occur.
How can I "communicate" to my widget that the process started and
after some calculations it is finished and then update my widget???
thanks
Here is my wrong way (I tried it only for the first row)
PRO my_widget_text_event, event
WIDGET_CONTROL, event.id,GET_VALUE=text
WIDGET_CONTROL,text1_,SET_VALUE=text1_msg
END
PRO my_widget_text, GROUP = GROUP
base = WIDGET_BASE(TITLE = 'Processing info', XSIZE = 300, /COLUMN,
XOFFSET=500, YOFFSET=300)
row1 = WIDGET_BASE(base, /ROW, /FRAME)
time_start_label = WIDGET_LABEL(row1,VALUE='Start Processing')
time_start_txt = widget_TEXT(row1,VALUE=string(systime()))
text1_msg='start process A'
text1 = WIDGET_TEXT(base, YSIZE= 1, VALUE=text1_msg SENSITIVE=0,/
FRAME, UVALUE=text1_msg)
text2_msg = 'process A ok'
text2 = WIDGET_TEXT(base, VALUE=text2_msg ,YSIZE = 1, /
FRAME,SENSITIVE=0,UVALUE=text2_msg)
text3_msg= 'Start process B'
text3 = WIDGET_TEXT(base,VALUE=text3_msg , YSIZE = 1,/
FRAME,SENSITIVE=0,UVALUE=text3_msg)
text4_msg='process b ok'
text4 = WIDGET_TEXT(base,VALUE=text4_msg ,YSIZE = 1,/
FRAME,SENSITIVE=0,UVALUE=text4_msg)
; Realize the widgets:
WIDGET_CONTROL, base, /REALIZE
XMANAGER, 'wtext', base, GROUP_LEADER =
GROUP,event_handler='my_widget_text_event', /NO_BLOCK
END
|
|
|