comparison examples/menu.py @ 42:585302e84c1f

fixed typo + added comment
author Goffi <goffi@goffi.org>
date Sun, 20 Feb 2011 00:37:54 +0100
parents 589e5e22f8f1
children e49d8f289a73
comparison
equal deleted inserted replaced
41:589e5e22f8f1 42:585302e84c1f
53 self.menu.addMenu(_menu2, "Item 2", self.menu_cb) 53 self.menu.addMenu(_menu2, "Item 2", self.menu_cb)
54 self.menu.addMenu(_menu2, "Item 3", self.menu_cb) 54 self.menu.addMenu(_menu2, "Item 3", self.menu_cb)
55 return self.menu 55 return self.menu
56 56
57 def keyHandler(self, input): 57 def keyHandler(self, input):
58 """We leave is user press 'esc'""" 58 """We leave if user press a quit char"""
59 if input in ('esc','q','Q'): 59 if input in ('esc','q','Q'):
60 raise urwid.ExitMainLoop() 60 raise urwid.ExitMainLoop()
61 else: 61 else:
62 return self.menu.checkShortcuts(input) 62 return self.menu.checkShortcuts(input) #needed to manage shortcuts
63 63
64 demo = MenuDemo() 64 demo = MenuDemo()
65 demo.run() 65 demo.run()