本文整理汇总了Python中tkinter.Canvas.after_cancel方法的典型用法代码示例。如果您正苦于以下问题:Python Canvas.after_cancel方法的具体用法?Python Canvas.after_cancel怎么用?Python Canvas.after_cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Canvas
的用法示例。
在下文中一共展示了Canvas.after_cancel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from tkinter import Canvas [as 别名]
# 或者: from tkinter.Canvas import after_cancel [as 别名]
#.........这里部分代码省略.........
textstr = self.players[1] + " Win"
elif self == 3 and self.scorePlayerA != self.scorePlayerB:
if self.scoreRoundB > self.scorePlayerA:
textstr = self.players[1] + " Win"
else:
textstr = self.players[0] + " Win"
else:
textstr = "Not Match"
self.canvas.create_oval(midw - 50, midh - 20, midw + 50, midh+20, fill="alice blue", outline="white", tag="wintera")
self.canvas.create_text(midw, midh, text=textstr, fill="blue violet", tag="winterb")
self.canvas.pack()
self.canvas.update();
def clearWinter(self):
self.canvas.delete("wintera")
self.canvas.delete("winterb")
self.canvas.update()
def quitRound(self, status):
if self.scorePlayerA >= self.maxRoundScore and self.scorePlayerB >= self.maxRoundScore:
self.isQuitRound = 1
if status == 1 or status == 2 or self.isQuitRound == 1 or self.quitMatch == 1:
if self.isQuitRound == 0:
self.updateScoreRound(status - 1)
self.isQuitRound = 1
self.ball.quit(self.canvas)
self.leftBar.quit(self.canvas)
self.rightBar.quit(self.canvas)
return self.isQuitRound
def nextRound(self, status):
self.canvas.after_cancel(self.canvas_after_2)
if status == 2 or status == 1:
if self.maxRound > self.countRound:
#self.ball.quit(self.canvas)
#self.leftBar.quit(self.canvas)
#self.rightBar.quit(self.canvas)
self.resetRound()
self.countRound += 1
self.leftBar.reset(self.canvas)
self.rightBar.reset(self.canvas)
if status == 1:
self.leftBar.transferBall(self.canvas, self.ball)
else:
self.leftBar.transferBall(self.canvas, self.ball)
#print(self.canvas.find_withtag(self.ball.name))
else:
self.stopMatch()
def play(self, event):
self.clearDashboard()
self.unRegisterKeyboard()
if event.keycode == 112:
self.isPause = 4
self.startMatch()
self.machineVSmachine()
elif event.keycode == 113:
self.isPause = 5
self.leftBar.registerKeyboard(self.frame)
self.startMatch()
self.machineVShuman()
elif event.keycode == 114:
self.isPause = 6