Re: IDL windows freeze (on windows) [message #54306] |
Wed, 06 June 2007 21:30 |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
On Jun 6, 11:31 pm, David Fanning <n...@dfanning.com> wrote:
>
> Can you explain in a little more detail how you use this.
> I'm curious about the problem.
>
Here's an example that illustrates the problem:
pro freeze_example
use_progress_bar = 0
use_mgh_waiter = 0
window, 1, xsize=400, ysize=400
wset, 1
device, set_graphics=6
stra = 'PROGRESS : ' + string(float(0)*100, format='(F6.2)')+' %'
xyouts, 0.5, 0.5, stra, alignment=1.0, CHARSIZE=1.25, /NORMAL
if use_progress_bar then begin
oprogbar = OBJ_NEW('progressbar', TITLE='WORKING', /NOCANCEL)
oprogbar -> Start
endif
if use_mgh_waiter then begin
owaiter = OBJ_NEW('MGHwaiter', TITLE='WORKING')
endif
for i = long(0), 10000 do begin
; do something time consuming here, for example
for j = long(0), 10000 do begin
a = fltarr(10000)
endfor
; update the user on progress
if i mod 100 eq 0 then begin
if use_progress_bar then oprogbar -> Update, (float(i)/
(100000))*100
if use_mgh_waiter then owaiter -> Yield
xyouts, 0.5, 0.5, stra, alignment=1.0, CHARSIZE=1.25, /
NORMAL
stra = 'PROGRESS : ' + string((float(i)/(100000))*100,
format='(F6.2)')+' %'
xyouts, 0.5, 0.5, stra, alignment=1.0, CHARSIZE=1.25, /
NORMAL
endif
endfor
if use_progress_bar then OBJ_DESTROY, oprogbar
if use_mgh_waiter then OBJ_DESTROY, owaiter
device, set_graphics=3
end
If both use_progress_bar and use_mgh_waiter are set to zero, then the
user can see updates on the task progress in the window as long as
they don't interfere with the window in any way, ie. as long as they
don't minimize it, drag something in front of it, etc etc. Any of
these actions will result in the window going blank and simply showing
a white space until the task has completed. Not only that but the
entire IDLDE is locked up. This can be very annoying if you are
running lots of long tasks! This is true for Object graphics windows
and direct graphics windows. This is a Windows-specific problem
apparantly - I've read that this doesn't happen on Unix machines. I'm
running IDL 6.2 and Windows XP Pro.
If one of use_progress_bar or use_mgh_waiter are set to 1, the problem
is avoided. These objects force windows to update the IDL graphics
windows and manage the IDLDE.
Sorry David regarding my earlier comment about Progressbar not solving
the problem - I must have made some mistake. When I wrote this
example it worked fine.
Mark Bates
Harvard University
Dept. of Chemistry and Chemical Biology
|
|
|
Re: IDL windows freeze (on windows) [message #54308 is a reply to message #54306] |
Wed, 06 June 2007 20:31  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
markb77@gmail.com writes:
> Oops - I take it all back - Mark Hadfield's MGHwaiter does the trick,
> as mentioned in previous posts. I was just neglecting to call its
> Yield method during my operation.
Can you explain in a little more detail how you use this.
I'm curious about the problem.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: IDL windows freeze (on windows) [message #54310 is a reply to message #54309] |
Wed, 06 June 2007 18:56  |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
On Jun 6, 6:30 pm, David Fanning <n...@dfanning.com> wrote:
> mark...@gmail.com writes:
>> Even David Fanning's progressbar widget freezes up when
>> minimized.
>
> Humm. I thought I wrote it so that it was IMPOSSIBLE to
> minimize. :-(
>
Actually David, I think what I saw was that the progressbar was
completely blanked out when the screen comes back on after having gone
to the screensaver. That's the same kind of behaviour I see from the
other idl windows - they just don't refresh - they're all blank. :(
Mark
|
|
|
Re: IDL windows freeze (on windows) [message #54311 is a reply to message #54310] |
Wed, 06 June 2007 15:30  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
markb77@gmail.com writes:
> Even David Fanning's progressbar widget freezes up when
> minimized.
Humm. I thought I wrote it so that it was IMPOSSIBLE to
minimize. :-(
Cheers,
David
P.S. Don't know about this kind of freezing. I can't think
of any reason why it might do this.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|