本文整理匯總了Python中Event.next方法的典型用法代碼示例。如果您正苦於以下問題:Python Event.next方法的具體用法?Python Event.next怎麽用?Python Event.next使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Event
的用法示例。
在下文中一共展示了Event.next方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: import Event [as 別名]
# 或者: from Event import next [as 別名]
def main():
print("Handler Chain #1")
pipeline = key_handler(mouse_handler(timer_handler()))
while True:
event = Event.next()
if event.kind == Event.TERMINATE:
break
pipeline.send(event)
print("\nHandler Chain #2 (debugging)")
pipeline = debug_handler(pipeline)
while True:
event = Event.next()
if event.kind == Event.TERMINATE:
break
pipeline.send(event)
示例2: main
# 需要導入模塊: import Event [as 別名]
# 或者: from Event import next [as 別名]
def main():
print("Handler Chain #1")
handler1 = TimerHandler(KeyHandler(MouseHandler(NullHandler())))
# Could pass None or nothing instead of the NullHandler
while True:
event = Event.next()
if event.kind == Event.TERMINATE:
break
handler1.handle(event)
print("\nHandler Chain #2 (debugging)")
handler2 = DebugHandler(handler1)
while True:
event = Event.next()
if event.kind == Event.TERMINATE:
break
handler2.handle(event)