How do i write an "application progress" widget ? [message #66355] |
Wed, 29 April 2009 05:26 |
lbusett@yahoo.it
Messages: 30 Registered: February 2006
|
Member |
|
|
Hi all,
I'm writing an IDL application and I need a "progress message" to
be output to the user providing information about process completion
status. I'm currently trying something like this:
Message_wid = WIDGET_BASE(title = 'Processing', xsize =300, Ysize =
100,/base_align_center, $
xoffset = 200, yoffset = 200, /COLUMN,TLB_FRAME_ATTR=1+2+8+16)
prog_wid = WIDGET_LABEL(message_wid,value = '', uname = 'range_label',
$
font='Arial*12*Bold', ysize = 16, xsize = 200)
WIDGET_CONTROL, message_wid, /REALIZE
count = 4
FOR i = 0, 3L do begin ; Main Cycle of the application
; Update the "processing message"
Progress_mess = 'Processing Range: '+STRTRIM(i+1,2)+' of
'+STRTRIM(count,2)
WIDGET_CONTROL,prog_wid, set_value = Progress_mess
; Do something
for k = 0L, 500000 do begin ; Do something
dummy = indgen (10000)
endfor
endfor
end
This works well if I don't do anything on my PC during program
execution, but if I pass to another application (e.g., word, explorer,
etc) and then I try to visualize again the progress window by
selecting the corresponding "button" on the windows application
toolbar, frequently the progress window does not show up anymore, or
it shows up as "blank" (only the title is visible).
What do I need to do to make a "progress widget" like this to be
correctly displayed ?
Thanks in advance for the help,
Lorenzo
|
|
|