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

Home » Public Forums » archive » Updateable Message Widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Updateable Message Widget [message #4755] Tue, 01 August 1995 00:00 Go to previous message
cavanaug is currently offline  cavanaug
Messages: 18
Registered: December 1994
Junior Member
I've been trying to develop a clean method of having an updateable window
in some of my larger programs. The plan is to use this window to keep the program
user current on the program's processing status (rather than just printing to the
xterm). I finally settled on the method below, but it's not as clean as I would like.
Notice that the widget is realized but not registered (and therefore, I assume, needs
no event handler), and that to destroy the widget, I have to pass widget id - 1 to
widget_control. Weird. Does anyone have a better way of handling this?

Thanks in advance,

Charles


function updatebox, title = title, message = message, xsize = xsize, ysize = ysize
; IDL 4.0, AIX 4.1
; get the dimensions, message and title
if n_elements (xsize) eq 0 then xsize = 300
if n_elements (ysize) eq 0 then ysize = 50
if n_elements (title) eq 0 then title = ' MESSAGE!! '
if n_elements (message) eq 0 then message = ' '

; create the box
base = widget_base (title = title, /column)
upid = widget_label (base, value = message, xsize = xsize, ysize = ysize)

; realize but dont register (this is the only way I could return the widget id)
widget_control, base, /realize

; return the id of the writeable section of the box
return, upid
end

pro utest
boxid = updatebox (title = "Update Test", xsize = 200, ysize = 30)
widget_control, boxid, set_value = "ID of this box is " + strtrim (boxid, 2)
wait, 1.0 ; simulate doing something
widget_control, boxid, set_value = "Doing something . . ."
wait, 1.0
widget_control, boxid, set_value = "Doing another thing . . ."
wait, 1.0
widget_control, boxid, set_value = "Last thing to do . . ."
wait, 1.0
widget_control, boxid - 1, /destroy
end


--
Charles Cavanaugh | "Words are very unnecessary, they can only do harm"
cavanaug@ncar.ucar.edu | - Depeche Mode
NCAR Boulder, CO, USA | "Facts all come with points of view"
My opinions | - Talking Heads
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Increasing the whitespace between plot axes and the label?
Next Topic: Does anyone have any experience with using SciDB with IDL (or any other language)?

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

Current Time: Wed Oct 08 15:07:33 PDT 2025

Total time taken to generate the page: 0.00848 seconds