Hello Franz & NG,
this, I have also thought, but it didn't work.
So I remember of wx.Yield and this lead to sucess.
On WinXp at least: if you remove comment Refresh out and
comment wx.Yield, it doesn't work.
Yes, you are right, I should have checked it before posting . wx.Yield
and friends remind me the famous quote about wx.CallAfter: "When everything
else fails, try wx.CallAfter". I think it could be applied also to wx.Yield
and friends
Andrea.
路路路
_______________________________________________
Andrea Gavana
Reservoir Engineer
MOGI ? Reservoir Characterization and Modeling Dept.
ENI S.p.A. ? Exploration & Production Division
Via Emilia, 1 ? 20097 San Donato Milanese (MI) ? Italy
Phone: +39 02 520 62972
Fax: +39 02 520 61824
E-mail: andrea.gavana@agip.it
Restyled Internet Site: http://xoomer.virgilio.it/infinity77/
____________________________________________________
Eni S.p.A.
Sede legale in Roma,
Piazzale Enrico Mattei 1, 00144 Roma
Tel. centralino: +39 06598.21
www.eni.it
Capitale sociale 聙 4.002.934.326 i.v.
Registro Imprese di Roma,
Codice Fiscale 00484960588
Part. IVA 00905811006
R.E.A. Roma n. 756453
Hi Andrea,
I suspect (not sure):
within the sleep loop, no other events are or rather can be handled;
not only before leaving that function.
So Refresh isn't working.
The Yield thingy:
from the docs:
"""
Yields control to pending messages in the windowing system. This can be useful, for example,
when a time-consuming process writes to a text window. Without an occasional yield,
the text window will not be updated properly,...
Note that Yield() will not flush the message logs. This is intentional as calling Yield()
is usually done to quickly update the screen and popping up a message box dialog may be undesirable.
"""
wx.SafeYield
"""
This function is similar to wxYield, except that it disables the user input to all program windows before
calling wxYield and re-enables it again afterwards.
If win is not NULL, this window will remain enabled,
allowing the implementation of some limited user interaction.
"""
So in my understanding, it ensures the event handling while the program is a kind of "stuck" for some time,
and it is better to use wx.SafeYield, so I would replace
wx.Yield()
by:
wx.SafeYield(onlyIfNeeded=True)
路路路
On Wed, 23 Nov 2005 17:09:09 +0100, andrea.gavana@agip.it wrote:
Hello Franz & NG,
this, I have also thought, but it didn't work.
So I remember of wx.Yield and this lead to sucess.
On WinXp at least: if you remove comment Refresh out and
comment wx.Yield, it doesn't work.
Yes, you are right, I should have checked it before posting . wx.Yield
and friends remind me the famous quote about wx.CallAfter: "When everything
else fails, try wx.CallAfter". I think it could be applied also to wx.Yield
and friends
Andrea.
--
Franz Steinhaeusler