gtoolz.MenuBox

# ``gtoolz`.`MenuBox``

class documentation

`class MenuBox:`

View In Hierarchy

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_selection` | 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

def __init__(self, name):

Undocumented

def add_selection(self, selection):

Undocumented

def show(self):

Undocumented

bclr: `str` =

Undocumented

center: `bool` =

Undocumented

clines: `int` =

Undocumented

cnt: `int` =

Undocumented

msgs: `list` =

Undocumented

name =

Undocumented

selections: `dict` =

Undocumented

title =

Undocumented