- Nicer cursors.
This commit is contained in:
parent
77621fae0b
commit
3a2505dd18
@ -79,12 +79,13 @@ class AttackThread(threading.Thread):
|
|||||||
background """
|
background """
|
||||||
|
|
||||||
# Override Thread's __init__ method to accept the parameters needed:
|
# Override Thread's __init__ method to accept the parameters needed:
|
||||||
def __init__ ( self, parent, resultwin, callbackclaim=None,callbackattack=None ):
|
def __init__ ( self, parent, resultwin, callbackclaim=None,callbackattack=None,callbackdone=None ):
|
||||||
|
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.resultwin = resultwin
|
self.resultwin = resultwin
|
||||||
self.callbackclaim = callbackclaim
|
self.callbackclaim = callbackclaim
|
||||||
self.callbackattack = callbackattack
|
self.callbackattack = callbackattack
|
||||||
|
self.callbackdone = callbackdone
|
||||||
self.totalattacks = 0
|
self.totalattacks = 0
|
||||||
for cl in self.parent.claims:
|
for cl in self.parent.claims:
|
||||||
for attack in cl.attacks:
|
for attack in cl.attacks:
|
||||||
@ -110,6 +111,8 @@ class AttackThread(threading.Thread):
|
|||||||
wx.CallAfter(self.callbackattack,attack,self.totalattacks,done)
|
wx.CallAfter(self.callbackattack,attack,self.totalattacks,done)
|
||||||
if self.callbackclaim:
|
if self.callbackclaim:
|
||||||
wx.CallAfter(self.callbackclaim,cl)
|
wx.CallAfter(self.callbackclaim,cl)
|
||||||
|
if self.callbackdone:
|
||||||
|
wx.CallAfter(self.callbackdone)
|
||||||
|
|
||||||
def makeImage(self,attack):
|
def makeImage(self,attack):
|
||||||
""" create image for this particular attack """
|
""" create image for this particular attack """
|
||||||
@ -435,11 +438,16 @@ class ScytherRun(object):
|
|||||||
claim.button.Enable()
|
claim.button.Enable()
|
||||||
#resultwin.Refresh()
|
#resultwin.Refresh()
|
||||||
|
|
||||||
|
def allDone():
|
||||||
|
resultwin.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
|
||||||
|
|
||||||
resultwin.Center()
|
resultwin.Center()
|
||||||
resultwin.Show(True)
|
resultwin.Show(True)
|
||||||
wx.Yield()
|
resultwin.SetCursor(wx.StockCursor(wx.CURSOR_ARROWWAIT))
|
||||||
|
|
||||||
t = AttackThread(self,resultwin,claimDone,attackDone)
|
wx.Yield()
|
||||||
|
|
||||||
|
t = AttackThread(self,resultwin,claimDone,attackDone,allDone)
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
resultwin.thread = t
|
resultwin.thread = t
|
||||||
|
Loading…
Reference in New Issue
Block a user