Files:
flexmenu.tcl main package
ex[0-9].tcl example scripts
i/ images for ex4.tcl
flexfb.tcl file browser example using flexmenu
Disadvantages:
* Does not work with .toplevel configure -menu .mymenu.
Tk uses the internal menu API to attach menus.
flexmenu cannot work with the -menu option.
* Must use pack or grid (or place) to attach the menu.
Converting an existing program to use flexmenu could be quite painful.
* The main menu must be created with either -type menubar or -type menuleft.
* It has not been tested much.
Advantages:
* Allows multiple menus to be active at the same time. You can have a main menu, a couple of toolbars and a side menu active
all at the same time.
* Easier to create toolbars.
Features:
* Supports left side menus (-type menuleft).
* Scrolling menus (-maxheight).
* Configure -columnbreak <value> at the menu level to automatically
break every <value> items.
* -keepopen option will leave the menu open after invoking an item.
* -acceleratorfont, -acceleratorforeground and
-acceleratoractiveforeground options.
* -activerelief option.
* -hidearrows option.
* -hideaccelerators option.
* -bindaccelerators option.
* -acceleratorprefix option to set the default accelerator prefix.
* -padx, -pady options to change the padding for menu items.
* -bindaccelerators option.
* -stickycascade option.
* -clicktoopen option.
* Is a little more dynamic than the standard menu.
Many things can be reconfigured and the changes will be picked up.
Item Features:
* Any widget can be put into the menu (.mymenu add widget -widget .mymenu.mycombobox).
* tearoff item type. (The -tearoff 1 option will automatically add
a tearoff item). The tearoff item is a label and the text and
image may be configured.
* Margin images (-marginimage). It is quite common nowadays to use small icons on the left margin of the menu as an aid for the user.
* Accelerator labels are automatically generated based on either an & prefix in the label, the -underline option, or the -accelerator option.
* Accelerator bindings are automatically generated.
* -activerelief option.
* -gap option.
* -keepopen option.
* Cascades: -yalign, -xalign, -precommand
Notes:
* Ignored: -bitmap, -selectcolor.
* -hidemargin works properly on a per-entry basis.
menu seems to treat it as a menu option even though it is specified per entry.
I think -hidemargin would be better off as a menu option rather than an item option,
but backwards compatibility is an issue.
Problems:
* May be overeager in generating accelerator labels.
The user may not want accelerator labels displayed for every item.
* Has not been tested much.
* At this time, flexmenu does not check to see if the entire menu is
visible, and does not do any relocation of the menu.
Known Issues:
* The clone command has only a very basic implementation.
* Flicker with -selectimage.
Currently, the menu layout is reapplied when a -image is changed
to a -selectimage.
This is just in case the -selectimage is a different size.
If the assumption can be made that the image sizes are identical, this
redraw could be removed.
* The MacOS aqua theme cannot set background colors, so the
active highlight changes the text color rather than the background color.