libtextworker 0.1.4
Cross-platform, free and open library for Python projects

◆ CreateMenu()

Menu libtextworker.interface.tk.miscs.CreateMenu ( list[dict[str]]  items,
Misc | None   parent = None,
Literal[0, 1]   tearoff = 0,
str   title = ... 
)
Make a Tkinter menu with commands inside.

Available keys can be found on tkinter.Menu.add_*, but whatever:
- label [str]           - handler [str|typing.Callable]
- accelerator [str]     - onvalue [=None]
- offvalue [=None]      - variable [=None]
- state [normal, active, disabled][=normal]
- kind [check, option, separator, normal] [=normal]

@param items (list[dict[str]]): Menu items to be added
@param parent (Misc | None = None): Where to place the Menu, optional
@param tearoff (1 or 0, defaults to 0): Whatever... Optional, ofc
@param title (str): Optional too, the title for the menu
@return tkinter.Menu

Definition at line 13 of file miscs.py.