The tklib library contains a menubar package that implements a menubar class. This class can be used to create an manage menubars in toplevel windows. The class doesn't depend on a widget framework and therefore can be used with or without a framework (e.g. Bwidget, IWidget, Snit, etc.). Some of the features of this package are:
The package is written in pure Tcl/Tk but it uses TclOO so 8.6 or greater is suggested.
The following screen shots illustrate what is ment by scope control in the menubar class. In the screen shots below the same instance of the menubar class has been installed in each of the two toplevel windows. Below the windows are two menus that have been tornoff from the same location in the menubar of each of the toplevel windows.
In this first screen shot illustrates what is ment by global scope. Each of these menus was created using the global (i.e. default) scope. As a result the value of the items are the same for both menus and changing one menu will cause the other menu to also be changed.
This second screen shot is similar to the first but the menus have been created using the local scope modifier. Notice that even though the menus have identical items the value of the items on the left are different from the items on the right. These menus have values that are scoped local to their associated toplevel window.
The following two screen shots illustrate how tab selection can be used to control the value settings of check and radio buttons. Notice that in the first screen shot tab1 is selected in both toplevel windows and in the second screen shot tab2 is selected.