`MenuBar` and `MenuBox`
Amar1729 opened this issue · 1 comments
I'm not entirely sure how to use the MenuBar
or MenuBox
widgets. I read through the code a little bit and what I think I understand is -
MenuBar
takes a menu_struct
parameter to initialize, which i gather is supposed to be a dictionary like { "label": Widget }
where Widget
is specifically a type of widget that supports interaction?
sidenote - Not sure if this is a bug, but if I pass a dictionary containing say a WLabel
as one of the widgets, the MenuBar
will fail to display it because WLabel
s don't have a self.kbuf
attribute (should WLabel
and other non-interactive widgets call super().__init__()
in their own __init__
?)
So if I pass radiobuttons or checkboxes as the widgets for the MenuBar, is the typical use case for this to function as something like a horizontal "multiple choice dropdown" that can expand different interactive widgets?
another sidenote - passing a WDropDown
doesn't work well either, since a dropdown's handle_key
calls self.owner.redraw()
, and self.owner
isn't set for dropdowns or comboboxes in a menu bar (it's only set when those items are added to a Dialog). not sure if this is expected behavior either.
WMenuBox
seems similar but smaller+vertical rather than horizontal.
From README:
Documentation
Picotui is an experimental WIP project, and the best documentation currently is the source code (https://github.com/pfalcon/picotui/tree/master/picotui) and examples (see below).
Examples
...
example_menu.py - Shows a "fullscreen" application with a main menu.