The combo widget

In Brief

This widget provides a platform native way for users to select one option from a list.

On Mac: a menubutton with attached menu is used; on Windows and X11, a read-only entry field combobox.

Commands

::tclmacbag::combo pathName ?Options?

Available options:

Required options: -textvariable, -values.

::tclmacbag::combo_Set pathName ?Options?

Available options:

Example

grid [::tclmacbag::combo .c -textvariable animals -values {Cat Dog}] -row 1 -column 2

Further Info

This was one of the first widgets written, well before I planned TclMacBag as a package. It exists because Mac users expressed outright horror at a combobox appearing in Mac applications, both in concept and in its Tile 0.7.8 implimentation.

The following options for the respective Tile widgets aren't (currently) supported by this metawidget: -height, -width, -exportselection, and -justify.

By default, this widget takes the background color of the Tile theme (on Windows and X11) or Pinstripe (on Mac). The Mac variation of the widget has a width sized to that of the value with the most characters.

Do not attempt to change settings in this widget by using $w configure.

As is standard, ::tclmacbag::combo returns with value of pathName, for ease of use with geometry managers like grid and pack.