The Personal Web Pages of Chris X. EdwardsA Simplified Tk Reference |
Keyword: | menubutton |
Description: | Very similar to the menu widget, but it is associated with a button style object. |
Example: | #note- Simple text menubutton menubutton .nav -text "Navigate" -menu .nav.options -underline 0 menu .nav.options .nav.options add command -label Previous -underline 0 -command {puts Previous} .nav.options add command -label Contents -underline 0 -command {puts Contents} .nav.options add command -label Next -underline 0 -command {puts Next} pack .nav |
Example: | #note- Menubutton with graphics image create photo img::a -file os-a.gif -format gif image create photo img::b -file os-b.gif -format gif image create photo img::l -file os-l.gif -format gif image create photo img::ta -file tiny-a.gif -format gif image create photo img::tb -file tiny-b.gif -format gif image create photo img::tl -file tiny-l.gif -format gif label .osnow -image img::a menubutton .os -text "You have a choice!" -menu .os.options -underline 0 menu .os.options .os.options add command -image img::ta -command {.osnow configure -image img::a} .os.options add command -image img::tb -command {.osnow configure -image img::b} .os.options add command -image img::tl -command {.osnow configure -image img::l} pack .os .osnow |
Official Syntax: |
http://www.scriptics.com/man/tcl8.4/TkCmd/menubutton.htm |
Previous | Home | Next |
This page was created with only free, open-source, publicly licensed software.
This page was designed to be viewed with any browser on any system. | ||
Chris X. Edwards ~ January 2004 |