Programming |  Tck/Tk Programming |  Tk Widgets |  optionMenu

tk_optionMenu

Makes a button, which when clicked on shows a list with available options. Useful when user has to make one choice when multiple choices are given. Below is a options menu in HTML. A word of caution though - Tcl/Tk's option menu has a very different appearance.

Syntax

tk_optionMenu path varName value ?value value ...?

Example...

set opt "Two"
tk_optionMenu .omn opt "One" "Two" "Three" "Four" "Five" "etc."
pack .omn