From: Aaron Brady [mailto:castironpi@comcast.net]
Sent: Thursday, January 17, 2008 8:34 PM
> From: Aaron Brady [mailto:castironpi@comcast.net]
> Sent: Wednesday, January 09, 2008 5:21 PM
Here's a splash. Perky li'l. Attached & reproduced.
Thinking still.
Here's the catch.
Repaired. Attached.
@ThreadEx
def thr1( thr1 ):
while 1:
with thr1.finishlock:
if not thr1.bContinue: break
AsyncCall( gauge1.Pulse ) #do not Wait
caption= AsyncCall( text1.GetValue ).Wait( 1 )
print 'Text: %s\n'% caption,
time.sleep( .1 )
Here:
def thr1( thr1 ):
while thr1.bContinue:
AsyncCall( gauge1.Pulse ) #do not Wait
captcall= AsyncCall( text1.GetValue )
caption= captcall.Wait()
print 'Text: %s\n'% caption,
time.sleep( .01 )
wx.CallAfter( frame.Destroy )
@BindEx( frame, wx.EVT_CLOSE )
def onclose( event ):
thr1.bContinue= False
with thr1.finishlock: pass
event.Skip()
And here:
@BindEx( frame, wx.EVT_CLOSE )
def onclose( event ):
event.Skip( False )
thr1.bContinue= False
Just move Destroy to the end of 'thr1', and remove thr1.finishlock.
You could even do:
frame.Bind( wx.EVT_CLOSE, lambda e: ( e.Skip( False ), thr1.Stop() )
)
for the binding.
asyncable-revised.py (2.28 KB)
···
-----Original Message-----
> -----Original Message-----