ttk_menubutton(3tk)

ttk_menubutton3tk

Widget that pops down a menu when pressed

Usage

ttk::menubutton pathName ?options?


    


    


    

Overview

A ttk::menubutton widget displays a textual label and/or image, and displays a menu when pressed.

Options

-class	-compound	-cursor
-image	-state	-style
-takefocus	-text	-textvariable
-underline	-width

See the manual entry for details on the standard options.

Options

Command-Line Name:	-direction
Database Name:	direction
Database Class:	Direction

Specifies where the menu is to be popped up relative to the menubutton. One of: above, below, left, right, or flush. The default is below. flush pops the menu up directly over the menubutton.

Command-Line Name:	-menu
Database Name:	menu
Database Class:	Menu

Specifies 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 cget, configure, identify, instate, and state methods. No other widget methods are used.

Standard styles

Ttk::menubutton widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.

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

widget, button, menu

Releases

8 releases since Debian 5.0 (Lenny); the text changed 5 times.

  1. 5.0
  2. 6.0
  3. 8
  4. 9
  5. 10
  6. 11–13

From tk8.6-doc 8.6.16-1 in Debian 13 (Trixie). Also shipped by tk9.0-doc. Parsed by carta from the page's man source.