21.16. The Optionmenu WidgetUse the Optionmenu method to create an option menu, in which the selected item is the value displayed. For example: $mainwindow->OptionMenu(-textvariable => \$platform, -options => [ [ "UNIX", "unix" ], [ "Windows NT", "winnt" ], [ "Macintosh", "mac" ] ]) -> pack; The -options argument takes a list of menu items. If the descriptions of the menu items displayed are different from those of the values stored, the menu items are themselves written as two-item lists. The standard configuration options that apply to Optionmenu are: -activeback-ground, -activeforeground, -background, -bg, -bitmap, -borderwidth, -bw, -cursor, -disabledforeground, -font, -foreground, -fg, -highlightbackground, -highlight-color, -highlightthickness, -image, -justify, -relief, -state, -takefocus, -un-derline, -width, and -wraplength. Other options are:
Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|