Home › Tk Themed Widget Tk
ttk::menubutton
Widget that pops down a menu when pressed
literal type exactly as shown
argument replace with your value
?optional? may be omitted
Synopsis#
ttk::menubutton pathName ?options?
Description#
A ttk::menubutton widget displays a textual label and/or image, and displays a menu when pressed.
Standard Options#
| -class | -compound | -cursor |
| -image | -state | -style |
| -takefocus | -text | -textvariable |
| -underline | -width |
See the ttk_widget manual entry for details on the standard options.
Widget-specific options#
-direction#-
Database name directionDatabase class DirectionSpecifies where the menu is to be popped up relative to the menubutton. One of:
above,below,left,right, orflush. The default isbelow.flushpops the menu up directly over the menubutton. -
Database name menuDatabase class MenuSpecifies the path name of the menu associated with the menubutton. To be on the safe side, the menu ought to be a direct child of the menubutton.
Widget command#
Menubutton widgets support the standard commands cget, configure, identify element, instate, state and style (see ttk::widget).
Standard styles#
Ttk::menubutton widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.
Styling options#
The class name for a ttk::menubutton is TMenubutton.
Dynamic states: active, disabled, readonly.
TMenubutton styling options configurable with ttk::style are:
-arrowsize amount
-background color
-compound compound
-foreground color
-font font
-padding padding
-relief relief
-width amount
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
Keywords#
Copyright#
- Copyright © 2004 Joe English