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 shot help illustrate the scope control and dynamic menu extension features of the menubar class.
The same instance of a menubar has been install in the above two toplevel windows. The same menu was tornoff from each window and positioned below the window. The menu that was tornoff was defined with global scope. Notice that the selected checkbutton and radiobutton items are the same for both windows.
This screen shot is similar to the first but the menus below the windows were created using the local scope modifier. Notice that even though the menus are identical the items on the menus can be set to different states. Thus the state is local to the toplevel window.