1 # -*- coding: utf-8 -*-
7 self
.stdscr
=curses
.initscr()
8 # Turn off echoing of keys, and enter cbreak mode,
9 # where no buffering is performed on keyboard input
13 # In keypad mode, escape sequences for special keys
14 # (like the cursor keys) will be interpreted and
15 # a special value like curses.KEY_LEFT will be returned
17 self
.main(stdscr
) # Enter the main loop
20 # Set everything back to normal
24 curses
.endwin() # Terminate curses
27 # Frame the interface area at fixed VT100 size
28 self
.screen
= stdscr
.subwin(23, 79, 0, 0)
30 self
.screen
.hline(2, 1, curses
.ACS_HLINE
, 77)
33 # Define the topbar menus
34 file_menu
= ("File", "file_func()")
35 proxy_menu
= ("Proxy Mode", "proxy_func()")
36 doit_menu
= ("Do It!", "doit_func()")
37 help_menu
= ("Help", "help_func()")
38 exit_menu
= ("Exit", "EXIT")
39 # Add the topbar menus to screen object
40 topbar_menu((file_menu
, proxy_menu
, doit_menu
,
41 help_menu
, exit_menu
))
43 # Enter the topbar menu loop
44 while topbar_key_handler():
51 if __name__
== '__main__':
55 http://old.tltsu.ru/archive/doc/programming/python/charming_python/charming_python_6.html