wxpython 2.8 -- timing and latency issues when displaying widgets

J

Josef Frank

Dear all,

in an application window (subwindow of a Notebook-control) I'm trying to
do the following:

1. Create a StaticText control kind of "Please wait until processing has
finished"
2. Do some processing (e.g. vacuuming an sqlite database)
3. Create a 2nd StaticText control with the message "processing finished"

Naïvely I would expect following behavior:

1st control appears
data processing step runs
after finishing processing the 2nd control appears

but actually the order in execution seems to be a different one:

computer is doing heavy processing
1st control appears
2nd control appears immediately after the 1st without any visible delay

Could someone give a hint, how to change the seeming behavior into the
intended one?

Thanks in advance Josef

P.S.:
here is the actual code snippet:

def OnVacuum(self,event):
panel=Ntab(self.desktop,"Compact")
message1=wx.StaticText(panel,-1,"Please wait, database is being
compacted.",(20,10))
self.SetCursor(wx.StockCursor(wx.CURSOR_WAIT))
con=sqlite3.connect(dbname)
cur=con.cursor()
cur.execute("VACUUM;")
cur.close()
con.close()
self.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
message2=wx.StaticText(panel,-1,"Compacting database has now
finished",(20,30))

Ntab is a class derived from wx.Panel and a tab of the abovementioned
wx.Notebook control
 

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top