wm title . "Menubar Example" ##========================================================= ## Creata a Menubar iwidget ## ## Add some menubuttons using the ## -menubuttons option ##========================================================= ## iwidgets::menubar .mb \ -helpvariable helpVar \ -menubuttons { menubutton file \ -text "File" \ -menu { command new \ -label "New" \ -command {puts "New Menu"} command open \ -label "Open" \ -command {puts "Open Menu"} command save \ -label "Save" \ -command {puts "Save Menu"} command exit \ -label "Exit" \ -command {puts "Exit Menu"} }; # end menu for file menubutton menubutton options \ -text "Options" \ -menu { cascade color \ -label "Color" \ -menu { radiobutton black \ -label "Black" radiobutton white \ -label "White" radiobutton blue \ -label "Blue" } command font \ -label "Font" \ -command {puts "Font Menu"} }; # end menu for options menubutton }; # end -menubttons option ## ## Try adding some menubuttons via the ## add public method ## .mb add menubutton help \ -text Help \ -menu { command helpbrowser \ -label "Help Browser" \ -command {puts "Help Browser"} command about \ -label "About" \ -command {puts "About"} } ## ## Create a scrolledtext so for illustration ## purposes ## iwidgets::scrolledtext .st \ -hscrollmode static \ -vscrollmode static \ -textbackground black \ -foreground green .st import [file join / usr local tcl8.3.3 README] ## ## Create a label to illustrate the help variable ## label .lb \ -textvariable helpVar pack .mb .st .lb \ -fill both \ -expand 1