hjin wrote:
> On May 9, 2:43 pm, Bryan Oakley <oak
@bardo.clearlight.com> wrote:
>> hjin wrote:
>>> How to add new items into the the option menu created by
>>> tk_optionMenu?
>>> Thanks a lot!
>> As described by the man page, tk_optionMenu returns the path to the menu
>> associated with the optionMenu. Once you get the menu name you can use
>> normal menu commands.
>> set menu [tk_optionMenu .om whatever red green blue]
>> $menu insert end separator
>> $menu insert end command -label "Hello, world"
>> pack .om
>> --
>> Bryan Oakleyhttp://www.tclscripting.com
> Could you tell me how to select the first item?
> I tried "$menu select 0" and it failed.
> Thanks a lot!
The menu is only visible when you click on the widget, so selecting