comparison examples/file_dialog.py @ 40:4da76342ae05

added Menu example
author Goffi <goffi@goffi.org>
date Sun, 20 Feb 2011 00:04:53 +0100
parents 818393067e54
children 585302e84c1f
comparison
equal deleted inserted replaced
39:8cc5970039f3 40:4da76342ae05
32 """This callback is called when user cancelled the dialog""" 32 """This callback is called when user cancelled the dialog"""
33 raise urwid.ExitMainLoop() 33 raise urwid.ExitMainLoop()
34 34
35 def test_quit(input): 35 def test_quit(input):
36 """We leave is user press 'esc'""" 36 """We leave is user press 'esc'"""
37 if input in ('esc'): 37 if input in ('esc',):
38 raise urwid.ExitMainLoop() 38 raise urwid.ExitMainLoop()
39 39
40 fd = FileDialog(ok_cb, cancel_cb) 40 fd = FileDialog(ok_cb, cancel_cb)
41 loop = urwid.MainLoop(fd, const_PALETTE, unhandled_input=test_quit) 41 loop = urwid.MainLoop(fd, const_PALETTE, unhandled_input=test_quit)
42 loop.run() 42 loop.run()