MenuBar¶
-
class
pygame_menu.widgets.
MenuBar
(label, width, background_color, back_box=False, mode=1000, onchange=None, onreturn=None, *args, **kwargs)[source]¶ Bases:
pygame_menu.widgets.core.widget.Widget
MenuBar widget.
Parameters: - label (str) – Title of the Menu
- width (int, float) – Width of the widget, generally width of the Menu
- background_color (tuple, list) – Background color
- back_box (bool) – Draw a back-box button on header
- mode (int) – Mode of drawing the bar
- onchange (callable, None) – Callback when changing the selector
- onreturn (callable, None) – Callback when pressing return button
- args (any) – Optional arguments for callbacks
- kwargs (any) – Optional keyword-arguments for callbacks
-
draw
(surface)[source]¶ Draw the widget shape.
Parameters: surface ( pygame.Surface
) – Surface to drawReturns: None