class MenuBox:
purpose: sets up a menu selection box executes selected function and arguments quits (returns) on "Enter" "Q" or "q" arguments: bclr: box color eg "reb" "blue" "green" clines: number of lines to center in the box center: center menu default is True methods: add_selection(["selection_name", func, arg1, arg2,...]) # needs an entry for arg(s) even if it is '' show() useage: mainmenu = Menu("Main") mainmenu.add_selection(["get statistics", get_stats, f"{symbol}"]) mainmenu.add_selection(["display_chart", do_chart, f"{symbol}"]) mainmenu.add_selection(["display_chart", run_fun, ""]) ans = "" while ans is not None: ans = mainmenu.show() notes: consider using gselect() instead of this. Your choice.
Method | __init__ |
Undocumented |
Method | add |
Undocumented |
Method | show |
Undocumented |
Instance Variable | bclr |
Undocumented |
Instance Variable | center |
Undocumented |
Instance Variable | clines |
Undocumented |
Instance Variable | cnt |
Undocumented |
Instance Variable | msgs |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | selections |
Undocumented |
Instance Variable | title |
Undocumented |