proc OptionMenu {w varName firstValue args} { upvar #0 $varName var if {![info exists var]} { set var $firstValue } menubutton $w -text [::msgcat::mc $firstValue] -indicatoron 1 -menu $w.menu \ -relief raised -bd 2 -highlightthickness 2 -anchor c \ -direction flush menu $w.menu -tearoff 0 $w.menu add radiobutton -label [::msgcat::mc $firstValue] -variable $varName \ -value $firstValue -command "UpdateOptionMenuLabel $w $varName" foreach i $args { $w.menu add radiobutton -label [::msgcat::mc $i] -variable $varName \ -value $i -command "UpdateOptionMenuLabel $w $varName" } return $w.menu } proc UpdateOptionMenuLabel {w v} { upvar #0 $v x $w configure -text [::msgcat::mc $x] } # Test: package require Tk package require msgcat namespace import msgcat::mcset #msgcat::mclocale en msgcat::mclocale de ;# <=====<< Select language # DE - German messages: mcset de "red" "Rot" mcset de "yellow" "Gelb" mcset de "green" "Grün" mcset de "blue" "Blau" mcset de "white" "Weiss" mcset de "black" "Schwarz" OptionMenu .f Color red yellow blue green magenta white black label .l -textvariable Color pack .l .f
HJG Its always nice to have an example that works by just copy+paste from the wiki...