procedure :menubutton name Creates a menubutton widget within the current panel frame for the TCL interpreter. A menubutton widget is a frame window containing a menubutton window and menu. name is used to generate the path name of the windows to be created. It should have the format of a widget name (e.g. :menubutton MENU) and should be unique within this interpreter. The name will be lower-cased (using the string tolower command) in order to generate the path name used to create the windows. When a menu item is selected by releasing mouse button 1 while the mouse focus is on a menu item then ,if available, the TCL script supplied using the :command parameter will be executed. If this is not available the TCL command click FRAME “ ” MENUBUTTON item index will be executed where FRAME and MENUBUTTON are widget names and item is the contents of the menu entry selected. If mouse button 3 is released while the mouse focus is on the menubutton window then the default menu entry is returned as item. index is the index (from zero) of the selected item in the menu. The path names generated have the root framename.panelname.menu- buttonname and the item menu. The :menubutton procedure may also be used directly within a frame window (i.e. before any panel window has been created). The :menubutton procedure may have a number of arguments however none of these is mandatory. arguments :x number number is the x-co-ordinate within the current panel of the menubutton widget in pixels e.g. :x 400 :y number number is the y-co-ordinate within the current panel of the menubutton widget in pixels e.g. :y 200 The :x and :y parameters may be omitted in which case the packer geometry manager will be used and the position of the window will be determined by the contents of the master (panel) window. If however the :x and :y parameters are supplied then the placer geometry manager will be used to position the window within the master (panel) window. Warning: Note that it is not possible to mix use of the packer and placer geometry managers within the same window. Thus all windows within a panel must request or imply that the same geometry manager is used. :w number number is the width of the menubutton window in characters. e.g. :w 20 :h number number is the height of the menubutton window in lines of text. e.g. :h 2 The :w and/or :h parameters may be omitted in which case the size of the menubutton will be determined by its contents. If however the :w and :h parameters are supplied then these will be used to configure the button window. Normally :h will not be supplied. :value value value is the index of the default menu item within the menu. The default value is 0. :label string string is a text string to be written onto the menubutton window. The default is the name of the menubutton widget. :strings list list is a simple TCL list of text strings which form the elements of the menu. The default is a null list and hence an empty menu. :menu list list is a TCL list of items which form the elements of the menu. Each item may be a simple string in which case it is appended as the name of a command in the current menu. However an item may itself be a list in which case the first element of the item is appended as the name of a cascade in the current menu and the remaining elements of the item are used to construct the cascade menu. It is not meaningful that :menu and :string are both specified in the same command. :command string string is any TCL command or commands to be executed when an event is generated. If a command is supplied and executed in this manner then the click procedure is not invoked The arguments :rows and :cols are no longer available since the use of :menu permits menus to be structured as required. See also common procedure arguments defined later in this document.