MenuButton
Bases: LocalizationMixin, TextSignalMixin, IconMixin, TTKWrapperBase, WidgetCapabilitiesMixin, TtkStateMixin, Menubutton
bootstack wrapper for ttk.Menubutton with bootstyle and icon support.
__init__
__init__(
master: Master = None,
**kwargs: Unpack[MenuButtonKwargs],
) -> None
Create a themed bootstack Menubutton.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
master
|
Master
|
Parent widget. If None, uses the default root window. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
text |
str
|
Text to display in the menubutton. |
image |
PhotoImage
|
Image to display. |
icon |
str | dict
|
Theme-aware icon spec handled by the style system. |
icon_only |
bool
|
If True, removes the additional padding reserved for label text. |
compound |
str
|
Placement of the image relative to text. |
direction |
str
|
Direction for the menu to appear. |
menu |
Menu
|
Associated tk.Menu instance. |
padding |
int | tuple
|
Extra space around the content. |
density |
str
|
The vertical and horizontal compactness of widget content, e.g. 'default', 'compact'. |
state |
str
|
Widget state. |
takefocus |
bool
|
Whether the widget participates in focus traversal. |
textvariable |
Variable
|
Tk variable linked to the text. |
textsignal |
Signal
|
Reactive Signal linked to the text (auto-synced with textvariable). |
style |
str
|
Explicit ttk style name (overrides accent/variant). |
accent |
str
|
Accent token for styling, e.g. 'primary', 'danger', 'success'. |
variant |
str
|
Style variant, e.g. 'solid', 'outline', 'ghost'. |
bootstyle |
str
|
DEPRECATED - Use |
surface |
str
|
Optional surface token; otherwise inherited. |
style_options |
dict
|
Optional dict forwarded to the style builder. |
localize |
bool | Literal['auto']
|
Determines the widget's localization mode. |