def main(stdscr): global menu_window, menu_panel, io_system, the_dispatcher curses.echo() panels = [] menu_window = curses.newwin(2, (iosys.WINDOW_WIDTH + 2) * 2 + 3) menu_panel = curses.panel.new_panel(menu_window) menu_window.addstr(1, 0, "Stack of runnable processes") menu_window.addstr(1, iosys.WINDOW_WIDTH + 3, "Set of waiting processes") the_dispatcher = dispatcher.Dispatcher() io_system = iosys.IO_Sys(the_dispatcher, panels) # setup the windows the_dispatcher.set_io_sys(io_system) menu("(n)ew, (f)ocus, (t)op, (k)ill, (h)alt, (p)ause, (w)ait, (q)uit")
def main(stdscr): # ALL processes have some iosys and dispatcher global menu_window, menu_panel, io_system, the_dispatcher curses.echo() panels = [] menu_window = curses.newwin(2, (iosys.WINDOW_WIDTH + 2) * 2 + 3) menu_panel = curses.panel.new_panel(menu_window) menu_window.addstr(1, 0, "Stack of runnable processes") menu_window.addstr(1, iosys.WINDOW_WIDTH + 3, "Set of waiting processes") # assigns a dispatcher object the_dispatcher = dispatcher.Dispatcher() # assigns the dispatcher to the iosys object. Also assigns the panels to allow manipulation io_system = iosys.IO_Sys(the_dispatcher, panels) # setup the windows # give the dispatcher an iosys the_dispatcher.set_io_sys(io_system) menu("(n)ew, (f)ocus, (t)op, (k)ill, (h)alt, (p)ause, (w)ait, (q)uit")