update not working

I have a strange problem where I make system calls in a loop
and also update the status bar of my frame after each system call.
Unfortunately, the text does not update properly. I’ll get the first 3
or 4 update text changing and then windows gives me a busy cursor and nothing
happens until the loop is complete. All the work is being done that I request
but the update stops refreshing even with a call to Refresh(True)

I have tried removing the system command and the updates go
further, (up to about 18 out of 22) and then stop but the loop still
continues.

I don’t really have a clue why I can’t regain
control of my status bar and make updates to it. The fact that it works for a
while puzzles me.

Anyone have an idea?

Thanks,

Michael

Hello,

I have a strange problem where I make system calls in a loop
and also update the status bar of my frame after each system call.
Unfortunately, the text does not update properly. I’ll get the first 3
or 4 update text changing and then windows gives me a busy cursor and nothing
happens until the loop is complete. All the work is being done that I request
but the update stops refreshing even with a call to Refresh(True)

I have tried removing the system command and the updates go
further, (up to about 18 out of 22) and then stop but the loop still
continues.

I don’t really have a clue why I can’t regain
control of my status bar and make updates to it. The fact that it works for a
while puzzles me.

Anyone have an idea?

Your loop is likely blocking wx’s event loop from making updates to the screen. Depending on what you are doing you could either add a wx.YieldIfNeeded(), or wx.SafeYield() after making your calls to update the status bar.

See:

http://wiki.wxpython.org/Non-Blocking%20Gui

http://wiki.wxpython.org/LongRunningTasks

For more details

Cody

···

On Wed, Nov 26, 2008 at 11:11 AM, Michael Toth michael@virtualpianist.com wrote:

Thanks,

Michael


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi Michael,

I have a strange problem where I make system calls in a loop and also update
the status bar of my frame after each system call. Unfortunately, the text
does not update properly. I'll get the first 3 or 4 update text changing
and then windows gives me a busy cursor and nothing happens until the loop
is complete. All the work is being done that I request but the update stops
refreshing even with a call to Refresh(True)

I have tried removing the system command and the updates go further, (up to
about 18 out of 22) and then stop but the loop still continues.

I don't really have a clue why I can't regain control of my status bar and
make updates to it. The fact that it works for a while puzzles me.

Anyone have an idea?

Try to put a call to:

wx.SafeYield()

After every call to your system function, OR a:

statusBar.Update()
statusBar.Refresh()

after every call to your system function.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Wed, Nov 26, 2008 at 5:11 PM, Michael Toth wrote:

Fabulous! Thank you all for helping on this perplexing problem!

-Michael

···

-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Andrea
Gavana
Sent: Wednesday, November 26, 2008 12:20 PM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] update not working

Hi Michael,

On Wed, Nov 26, 2008 at 5:11 PM, Michael Toth wrote:

I have a strange problem where I make system calls in a loop and also

update

the status bar of my frame after each system call. Unfortunately, the

text

does not update properly. I'll get the first 3 or 4 update text changing
and then windows gives me a busy cursor and nothing happens until the loop
is complete. All the work is being done that I request but the update

stops

refreshing even with a call to Refresh(True)

I have tried removing the system command and the updates go further, (up

to

about 18 out of 22) and then stop but the loop still continues.

I don't really have a clue why I can't regain control of my status bar and
make updates to it. The fact that it works for a while puzzles me.

Anyone have an idea?

Try to put a call to:

wx.SafeYield()

After every call to your system function, OR a:

statusBar.Update()
statusBar.Refresh()

after every call to your system function.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Dear Michalis,

You’re welcome. I guess that did the trick.

ML, Frans

···

From: michael@virtualpianist.com
To: wxpython-users@lists.wxwidgets.org
Subject: RE: [wxpython-users] update not working
Date: Wed, 26 Nov 2008 19:04:53 -0500

Fabulous! Thank you all for helping on this perplexing problem!

-Michael

-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Andrea
Gavana
Sent: Wednesday, November 26, 2008 12:20 PM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] update not working

Hi Michael,

On Wed, Nov 26, 2008 at 5:11 PM, Michael Toth wrote:

I have a strange problem where I make system calls in a loop and also
update
the status bar of my frame after each system call. Unfortunately, the
text
does not update properly. I’ll get the first 3 or 4 update text changing
and then windows gives me a busy cursor and nothing happens until the loop
is complete. All the work is being done that I request but the update
stops
refreshing even with a call to Refresh(True)

I have tried removing the system command and the updates go further, (up
to
about 18 out of 22) and then stop but the loop still continues.

I don’t really have a clue why I can’t regain control of my status bar and
make updates to it. The fact that it works for a while puzzles me.

Anyone have an idea?

Try to put a call to:

wx.SafeYield()

After every call to your system function, OR a:

statusBar.Update()
statusBar.Refresh()

after every call to your system function.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”
http://xoomer.alice.it/infinity77/


wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


Express yourself instantly with MSN Messenger! MSN Messenger