1mNAME0m
       menu - Create and manipulate menu widgets

1mSYNOPSIS0m
       1mmenu 4m22mpathName24m ?4moptions24m?

1mSTANDARD OPTIONS0m
       1m-activebackground     -background          -disabledforeground-relief0m
       1m-activeborderwidth    -borderwidth         -font-takefocus0m
       1m-activeforeground     -cursor              -foreground0m

       See the 1moptions 22mmanual entry for details on the standard options.

1mWIDGET-SPECIFIC OPTIONS0m
       Command-Line Name:1m-postcommand0m
       Database Name:  1mpostCommand0m
       Database Class: 1mCommand0m

              If  this  option  is specified then it provides a Tcl command to
              execute each time the menu is posted.  The command is invoked by
              the  1mpost  22mwidget  command before posting the menu. Note that in
              8.0 on Macintosh and Windows, all commands in a menu systems are
              executed  before  any are posted. This is due to the limitations
              in the individual platforms' menu managers.

       Command-Line Name:1m-selectcolor0m
       Database Name:  1mselectColor0m
       Database Class: 1mBackground0m

              For menu entries that are check buttons or radio  buttons,  this
              option  specifies the color to display in the indicator when the
              check button or radio button is selected.

       Command-Line Name:1m-tearoff0m
       Database Name:  1mtearOff0m
       Database Class: 1mTearOff0m

              This option must have a proper boolean  value,  which  specifies
              whether  or  not the menu should include a tear-off entry at the
              top.  If so, it will exist as entry 0 of the menu and the  other
              entries  will  number  starting at 1.  The default menu bindings
              arrange for the menu to be torn off when the tear-off  entry  is
              invoked.

       Command-Line Name:1m-tearoffcommand0m
       Database Name:  1mtearOffCommand0m
       Database Class: 1mTearOffCommand0m

              If  this  option  has a non-empty value, then it specifies a Tcl
              command to invoke whenever the menu is  torn  off.   The  actual
              command  will consist of the value of this option, followed by a
              space, followed by the name of the menu window,  followed  by  a
              space,  followed  by  the  name of the name of the torn off menu
              window.  For example, if the option's is ``1ma b22m'' and  menu  1m.x.y0m
              is  torn  off to create a new menu 1m.x.tearoff122m, then the command
              ``1ma b .x.y .x.tearoff122m'' will be invoked.

       Command-Line Name:1m-title0m
       Database Name:  1mtitle0m
       Database Class: 1mTitle0m

              The string will be used to title the window  created  when  this
              menu  is  torn  off.  If the title is NULL, then the window will
              have the title of the menubutton or the text of the cascade item
              from which this menu was invoked.

       Command-Line Name:1m-type0m
       Database Name:  1mtype0m
       Database Class: 1mType0m

              This  option  can  be one of 1mmenubar22m, 1mtearoff22m, or 1mnormal22m, and is
              set when the menu is created. While the string returned  by  the
              configuration  database  will  change if this option is changed,
              this does not affect the menu widget's behavior. This is used by
              the  cloning mechanism and is not normally set outside of the Tk
              library.


1mINTRODUCTION0m
       The 1mmenu 22mcommand creates a new top-level window (given by the  4mpathName0m
       argument)  and  makes  it  into  a  menu  widget.   Additional options,
       described above, may be specified on the command line or in the  option
       database  to configure aspects of the menu such as its colors and font.
       The 1mmenu 22mcommand returns its 4mpathName24m argument.  At the time this  com-
       mand  is  invoked,  there  must  not exist a window named 4mpathName24m, but
       4mpathName24m's parent must exist.

       A menu is a widget that  displays  a  collection  of  one-line  entries
       arranged  in  one or more columns.  There exist several different types
       of entries, each with different properties.  Entries of different types
       may  be  combined  in  a single menu.  Menu entries are not the same as
       entry widgets.  In fact, menu entries are not  even  distinct  widgets;
       the entire menu is one widget.

       Menu  entries are displayed with up to three separate fields.  The main
       field is a label in the form of a text string, a bitmap, or  an  image,
       controlled  by  the  1m-label22m, 1m-bitmap22m, and 1m-image 22moptions for the entry.
       If the  1m-accelerator 22moption is specified for an  entry  then  a  second
       textual  field is displayed to the right of the label.  The accelerator
       typically describes a keystroke sequence  that  may  be  typed  in  the
       application  to  cause the same result as invoking the menu entry.  The
       third field is an 4mindicator24m.  The indicator is present only for  check-
       button  or  radiobutton  entries.   It  indicates  whether the entry is
       selected or not, and is displayed to the left of the entry's string.

       In normal use, an entry becomes active  (displays  itself  differently)
       whenever  the  mouse  pointer  is over the entry.  If a mouse button is
       released over the entry then the entry is 4minvoked24m.  The effect of invo-
       cation is different for each type of entry; these effects are described
       below in the sections on individual entries.

       Entries may be 4mdisabled24m, which causes their labels and accelerators  to
       be  displayed  with  dimmer colors.  The default menu bindings will not
       allow a disabled entry to be activated or  invoked.   Disabled  entries
       may  be  re-enabled, at which point it becomes possible to activate and
       invoke them again.

       Whenever a menu's active entry is  changed,  a  <<MenuSelect>>  virtual
       event is send to the menu. The active item can then be queried from the
       menu, and an action can be taken,  such  as  setting  context-sensitive
       help text for the entry.


1mCOMMAND ENTRIES0m
       The  most  common  kind of menu entry is a command entry, which behaves
       much like a button widget.  When a command entry is invoked, a Tcl com-
       mand  is  executed.   The  Tcl  command  is specified with the 1m-command0m
       option.


1mSEPARATOR ENTRIES0m
       A separator is an entry that is  displayed  as  a  horizontal  dividing
       line.   A  separator  may  not  be  activated or invoked, and it has no
       behavior other than its display appearance.


1mCHECKBUTTON ENTRIES0m
       A checkbutton menu entry behaves much like a checkbutton widget.   When
       it  is invoked it toggles back and forth between the selected and dese-
       lected states.  When the entry  is  selected,  a  particular  value  is
       stored  in  a particular global variable (as determined by the 1m-onvalue0m
       and 1m-variable 22moptions for the entry);  when  the  entry  is  deselected
       another  value  (determined  by  the 1m-offvalue 22moption) is stored in the
       global variable.  An indicator box is displayed  to  the  left  of  the
       label  in a checkbutton entry.  If the entry is selected then the indi-
       cator's center is displayed in the  color  given  by  the  1m-selectcolor0m
       option  for the entry; otherwise the indicator's center is displayed in
       the background color for the menu.  If a 1m-command 22moption  is  specified
       for  a  checkbutton entry, then its value is evaluated as a Tcl command
       each time the entry  is  invoked;   this  happens  after  toggling  the
       entry's selected state.


1mRADIOBUTTON ENTRIES0m
       A  radiobutton  menu  entry  behaves  much  like  a radiobutton widget.
       Radiobutton entries are organized in groups of which only one entry may
       be selected at a time.  Whenever a particular entry becomes selected it
       stores a particular value into a particular global variable (as  deter-
       mined  by the 1m-value 22mand 1m-variable 22moptions for the entry).  This action
       causes any previously-selected entry in  the  same  group  to  deselect
       itself.   Once  an entry has become selected, any change to the entry's
       associated variable will cause the entry to deselect itself.   Grouping
       of radiobutton entries is determined by their associated variables:  if
       two entries have the same associated variable then they are in the same
       group.   An  indicator diamond is displayed to the left of the label in
       each radiobutton entry.  If the entry is selected then the  indicator's
       center  is  displayed in the color given by the 1m-selectcolor 22moption for
       the entry; otherwise the indicator's center is displayed in  the  back-
       ground  color  for  the  menu.  If a 1m-command 22moption is specified for a
       radiobutton entry, then its value is evaluated as a  Tcl  command  each
       time the entry is invoked;  this happens after selecting the entry.


1mCASCADE ENTRIES0m
       A cascade entry is one with an associated menu (determined by the 1m-menu0m
       option).  Cascade entries allow the construction  of  cascading  menus.
       The 1mpostcascade 22mwidget command can be used to post and unpost the asso-
       ciated menu just next to of the cascade  entry.   The  associated  menu
       must  be  a  child  of  the  menu containing the cascade entry (this is
       needed in order for menu traversal to work correctly).

       A cascade entry posts its associated menu by invoking a Tcl command  of
       the form
              4mmenu24m 1mpost 4m22mx24m 4my0m
       where 4mmenu24m is the path name of the associated menu, and 4mx24m and 4my24m are the
       root-window coordinates of the upper-right corner of the cascade entry.
       On  Unix,  the  lower-level menu is unposted by executing a Tcl command
       with the form
              4mmenu24m 1munpost0m
       where 4mmenu24m is the name of the associated menu.  On other platforms, the
       platform's native code takes care of unposting the menu.

       If a 1m-command 22moption is specified for a cascade entry then it is evalu-
       ated as a Tcl command whenever the entry is invoked. This is  not  sup-
       ported on Windows.


1mTEAR-OFF ENTRIES0m
       A  tear-off  entry  appears  at the top of the menu if enabled with the
       1mtearOff 22moption.  It is not like other menu entries in that it cannot be
       created  with  the  1madd  22mwidget  command and cannot be deleted with the
       1mdelete 22mwidget command.  When a tear-off entry is created it appears  as
       a  dashed  line  at  the  top of the menu.  Under the default bindings,
       invoking the tear-off entry causes a torn-off copy to be  made  of  the
       menu and all of its submenus.


1mMENUBARS0m
       Any  menu  can  be set as a menubar for a toplevel window (see 1mtoplevel0m
       command for syntax). On the Macintosh,  whenever  the  toplevel  is  in
       front,  this menu's cascade items will appear in the menubar across the
       top of the main monitor. On Windows and Unix, this menu's items will be
       displayed  in a menubar accross the top of the window. These menus will
       behave according to the interface guidelines of  their  platforms.  For
       every  menu set as a menubar, a clone menu is made. See the 1mCLONES 22msec-
       tion for more information.

       As noted, menubars may behave differently on different platforms.   One
       example  of this concerns the handling of checkbuttons and radiobuttons
       within the menu.  While it is permitted to put these menu  elements  on
       menubars,  they may not be drawn with indicators on some platforms, due
       to system restrictions.


1mSPECIAL MENUS IN MENUBARS0m
       Certain menus in a menubar will be treated specially.   On  the  Macin-
       tosh,  access  to the special Apple and Help menus is provided. On Win-
       dows, access to the Windows System menu in each window is provided.  On
       X  Windows,  a  special  right-justified  help menu is provided. In all
       cases, these menus must be created with the command name of the menubar
       menu  concatenated  with  the  special  name.  So  for  a menubar named
       .menubar, on the Macintosh, the special menus would  be  .menubar.apple
       and  .menubar.help; on Windows, the special menu would be .menubar.sys-
       tem; on X Windows, the help menu would be .menubar.help.

       When Tk sees an Apple menu on the Macintosh, that menu's contents  make
       up  the first items of the Apple menu on the screen whenever the window
       containing the menubar is in front. The menu is the first one that  the
       user sees and has a title which is an Apple logo.  After all of the Tk-
       defined items, the menu will have a separator, followed by all  of  the
       items  in  the user's Apple Menu Items folder.  Since the System uses a
       different menu definition procedure for the Apple menu than Tk uses for
       its menus, and the system APIs do not fully support everything Tk tries
       to do, the menu item  will  only  have  its  text  displayed.  No  font
       attributes,  images, bitmaps, or colors will be displayed. In addition,
       a menu with a tearoff item will have  the  tearoff  item  displayed  as
       "(TearOff)".

       When  Tk  see  a  Help  menu  on the Macintosh, the menu's contents are
       appended to the standard help menu on the right of the  user's  menubar
       whenever  the  user's  menubar is in front. The first items in the menu
       are provided by Apple. Similar to the Apple Menu, cusomization in  this
       menu is limited to what the system provides.

       When  Tk  sees  a System menu on Windows, its items are appended to the
       system menu that the menubar is attached to. This menu has an icon rep-
       resenting  a  spacebar,  and can be invoked with the mouse or by typing
       Alt+Spacebar.  Due to limitations in the Windows API, any font changes,
       colors,  images, bitmaps, or tearoff images will not appear in the sys-
       tem menu.

       When Tk see a Help menu on X Windows, the menu is moved to be  last  in
       the menubar and is right justified.


1mCLONES0m
       When  a  menu is set as a menubar for a toplevel window, or when a menu
       is torn off, a clone of the menu is made. This clone is a  menu  widget
       in  its  own  right,  but it is a child of the original. Changes in the
       configuration of the original are reflected in the clone. Additionally,
       any cascades that are pointed to are also cloned so that menu traversal
       will work right. Clones  are  destroyed  when  either  the  tearoff  or
       menubar goes away, or when the original menu is destroyed.


1mWIDGET COMMAND0m
       The  1mmenu  22mcommand  creates  a  new Tcl command whose name is 4mpathName24m.
       This command may be used to invoke various operations  on  the  widget.
       It has the following general form:
              4mpathName24m 4moption24m ?4marg24m 4marg24m 4m...24m?
       4mOption24m and the 4marg24ms determine the exact behavior of the command.

       Many  of the widget commands for a menu take as one argument an indica-
       tor of which entry of the menu to operate  on.   These  indicators  are
       called 4mindex24mes and may be specified in any of the following forms:

       4mnumber24m      Specifies the entry numerically, where 0 corresponds to the
                   top-most entry of the menu, 1 to the entry below it, and so
                   on.

       1mactive      22mIndicates  the entry that is currently active.  If no entry
                   is active then this form is equivalent to 1mnone22m.  This  form
                   may not be abbreviated.

       1mend         22mIndicates  the  bottommost entry in the menu.  If there are
                   no entries in the menu then  this  form  is  equivalent  to
                   1mnone22m.  This form may not be abbreviated.

       1mlast        22mSame as 1mend22m.

       1mnone        22mIndicates  ``no entry at all'';  this is used most commonly
                   with the 1mactivate 22moption to deactivate all the  entries  in
                   the  menu.   In most cases the specification of 1mnone 22mcauses
                   nothing to happen in the widget command.  This form may not
                   be abbreviated.

       1m@4m22mnumber24m     In  this  form,  4mnumber24m is treated as a y-coordinate in the
                   menu's window;  the entry closest to that  y-coordinate  is
                   used.   For example, ``1m@022m'' indicates the top-most entry in
                   the window.

       4mpattern24m     If the index doesn't satisfy one of the  above  forms  then
                   this  form is used.  4mPattern24m is pattern-matched against the
                   label of each entry in the menu,  in  order  from  the  top
                   down,  until  a  matching  entry  is  found.   The rules of
                   1mTcl_StringMatch 22mare used.

       The following widget commands are possible for menu widgets:

       4mpathName24m 1mactivate 4m22mindex0m
              Change the state of the entry indicated by 4mindex24m to  1mactive  22mand
              redisplay  it  using  its  active colors.  Any previously-active
              entry is deactivated.  If 4mindex24m is specified as 1mnone22m, or if  the
              specified  entry  is  disabled,  then  the  menu ends up with no
              active entry.  Returns an empty string.

       4mpathName24m 1madd 4m22mtype24m ?4moption24m 4mvalue24m 4moption24m 4mvalue24m 4m...24m?
              Add a new entry to the bottom of the menu.  The new entry's type
              is  given  by 4mtype24m and must be one of 1mcascade22m, 1mcheckbutton22m, 1mcom-0m
              1mmand22m, 1mradiobutton22m, or 1mseparator22m, or a unique abbreviation of one
              of the above.  If additional arguments are present, they specify
              any of the following options:

              1m-activebackground 4m22mvalue0m
                     Specifies a background color to use for  displaying  this
                     entry  when it is active.  If this option is specified as
                     an empty string (the default), then the  1mactiveBackground0m
                     option for the overall menu is used.  If the 1mtk_strictMo-0m
                     1mtif 22mvariable has been set to request strict Motif compli-
                     ance,  then  this  option  is ignored and the 1m-background0m
                     option is used in its place.  This option is  not  avail-
                     able for separator or tear-off entries.

              1m-activeforeground 4m22mvalue0m
                     Specifies  a  foreground color to use for displaying this
                     entry when it is active.  If this option is specified  as
                     an  empty string (the default), then the 1mactiveForeground0m
                     option for the overall menu is used.  This option is  not
                     available for separator or tear-off entries.

              1m-accelerator 4m22mvalue0m
                     Specifies  a  string  to display at the right side of the
                     menu entry.  Normally describes an accelerator  keystroke
                     sequence that may be typed to invoke the same function as
                     the menu entry.  This option is not available for separa-
                     tor or tear-off entries.

              1m-background 4m22mvalue0m
                     Specifies  a  background color to use for displaying this
                     entry when it is in the normal state (neither active  nor
                     disabled).   If  this  option  is  specified  as an empty
                     string (the default), then the 1mbackground 22moption for  the
                     overall  menu  is used.  This option is not available for
                     separator or tear-off entries.

              1m-bitmap 4m22mvalue0m
                     Specifies a bitmap to display in the menu  instead  of  a
                     textual  label,  in  any of the forms accepted by 1mTk_Get-0m
                     1mBitmap22m.  This option overrides the 1m-label 22moption but  may
                     be  reset to an empty string to enable a textual label to
                     be displayed.  If a 1m-image 22moption has been specified,  it
                     overrides 1m-bitmap22m.  This option is not available for sep-
                     arator or tear-off entries.

              1m-columnbreak 4m22mvalue0m
                     When this option is zero, the appears below the  previous
                     entry.  When  this option is one, the menu appears at the
                     top of a new column in the menu.

              1m-command 4m22mvalue0m
                     Specifies a Tcl command to execute when the menu entry is
                     invoked.    Not   available  for  separator  or  tear-off
                     entries.

              1m-font 4m22mvalue0m
                     Specifies the font to  use  when  drawing  the  label  or
                     accelerator  string  in  this  entry.   If this option is
                     specified as an empty string (the default) then the  1mfont0m
                     option  for the overall menu is used.  This option is not
                     available for separator or tear-off entries.

              1m-foreground 4m22mvalue0m
                     Specifies a foreground color to use for  displaying  this
                     entry  when it is in the normal state (neither active nor
                     disabled).  If this  option  is  specified  as  an  empty
                     string  (the default), then the 1mforeground 22moption for the
                     overall menu is used.  This option is not  available  for
                     separator or tear-off entries.

              1m-hidemargin 4m22mvalue0m
                     Specifies  whether  the  standard margins should be drawn
                     for this menu entry. This is useful when creating palette
                     with  images  in  them,  i.e.,  color  palettes,  pattern
                     palettes, etc. 1 indicates that the margin for the  entry
                     is hidden; 0 means that the margin is used.

              1m-image 4m22mvalue0m
                     Specifies  an  image  to display in the menu instead of a
                     text string or bitmap The image must have been created by
                     some  previous  invocation  of 1mimage create22m.  This option
                     overrides the 1m-label 22mand 1m-bitmap 22moptions but may be reset
                     to an empty string to enable a textual or bitmap label to
                     be displayed.  This option is not available for separator
                     or tear-off entries.

              1m-indicatoron 4m22mvalue0m
                     Available  only  for checkbutton and radiobutton entries.
                     4mValue24m is a boolean that determines  whether  or  not  the
                     indicator should be displayed.

              1m-label 4m22mvalue0m
                     Specifies  a string to display as an identifying label in
                     the menu entry.  Not available for separator or  tear-off
                     entries.

              1m-menu 4m22mvalue0m
                     Available  only  for cascade entries.  Specifies the path
                     name of the submenu associated with this entry.  The sub-
                     menu must be a child of the menu.

              1m-offvalue 4m22mvalue0m
                     Available  only  for  checkbutton entries.  Specifies the
                     value to store in the entry's  associated  variable  when
                     the entry is deselected.

              1m-onvalue 4m22mvalue0m
                     Available  only  for  checkbutton entries.  Specifies the
                     value to store in the entry's  associated  variable  when
                     the entry is selected.

              1m-selectcolor 4m22mvalue0m
                     Available  only  for checkbutton and radiobutton entries.
                     Specifies the color to display in the indicator when  the
                     entry  is selected.  If the value is an empty string (the
                     default) then the 1mselectColor 22moption for the menu  deter-
                     mines the indicator color.

              1m-selectimage 4m22mvalue0m
                     Available  only  for checkbutton and radiobutton entries.
                     Specifies an image to display in the entry (in  place  of
                     the  1m-image  22moption)  when  it is selected.  4mValue24m is the
                     name of an image, which must have been  created  by  some
                     previous  invocation  of  1mimage  create22m.   This option is
                     ignored unless the 1m-image 22moption has been specified.

              1m-state 4m22mvalue0m
                     Specifies one of three states  for  the  entry:   1mnormal22m,
                     1mactive22m,  or  1mdisabled22m.  In normal state the entry is dis-
                     played using the 1mforeground 22moption for the menu  and  the
                     1mbackground 22moption from the entry or the menu.  The active
                     state is typically used when  the  pointer  is  over  the
                     entry.   In active state the entry is displayed using the
                     1mactiveForeground 22moption  for  the  menu  along  with  the
                     1mactivebackground  22moption  from the entry.  Disabled state
                     means that the entry should be insensitive:  the  default
                     bindings will refuse to activate or invoke the entry.  In
                     this state the entry is displayed according to  the  1mdis-0m
                     1mabledForeground  22moption  for  the menu and the 1mbackground0m
                     option from the entry.  This option is not available  for
                     separator entries.

              1m-underline 4m22mvalue0m
                     Specifies  the  integer index of a character to underline
                     in the entry.  This option is also queried by the default
                     bindings  and  used  to  implement keyboard traversal.  0
                     corresponds to the first character of the text  displayed
                     in  the  entry, 1 to the next character, and so on.  If a
                     bitmap or image is  displayed  in  the  entry  then  this
                     option is ignored.  This option is not available for sep-
                     arator or tear-off entries.

              1m-value 4m22mvalue0m
                     Available only for radiobutton  entries.   Specifies  the
                     value  to  store  in the entry's associated variable when
                     the entry is selected.  If an empty string is  specified,
                     then  the  1m-label  22moption  for  the entry as the value to
                     store in the variable.

              1m-variable 4m22mvalue0m
                     Available only for checkbutton and  radiobutton  entries.
                     Specifies  the  name  of  a  global value to set when the
                     entry is selected.  For checkbutton entries the  variable
                     is  also set when the entry is deselected.  For radiobut-
                     ton entries, changing the variable causes the  currently-
                     selected entry to deselect itself.

              The 1madd 22mwidget command returns an empty string.

       4mpathName24m 1mcget 4m22moption0m
              Returns  the  current value of the configuration option given by
              4moption24m.  4mOption24m may have any of the values accepted by the  1mmenu0m
              command.

       4mpathName24m 1mclone 4m22mnewPathname24m 4m?cloneType?0m
              Makes  a clone of the current menu named 4mnewPathName24m. This clone
              is a menu in its own right, but any changes  to  the  clone  are
              propogated to the original menu and vice versa. 4mcloneType24m can be
              1mnormal22m, 1mmenubar22m, or 1mtearoff22m. Should not normally be called  out-
              side of the Tk library. See the 1mCLONES 22msection for more informa-
              tion.

       4mpathName24m 1mconfigure 22m?4moption24m? ?4mvalue24m 4moption24m 4mvalue24m 4m...24m?
              Query or modify the configuration options of the widget.  If  no
              4moption24m is specified, returns a list describing all of the avail-
              able options for 4mpathName24m (see 1mTk_ConfigureInfo 22mfor  information
              on  the  format  of  this list).  If 4moption24m is specified with no
              4mvalue24m, then the command returns a list describing the one  named
              option (this list will be identical to the corresponding sublist
              of the value returned if no 4moption24m is  specified).   If  one  or
              more 4moption-value24m pairs are specified, then the command modifies
              the given widget option(s) to have the given value(s);  in  this
              case  the  command returns an empty string.  4mOption24m may have any
              of the values accepted by the 1mmenu 22mcommand.

       4mpathName24m 1mdelete 4m22mindex124m ?4mindex224m?
              Delete all of the menu entries between 4mindex124m and 4mindex224m  inclu-
              sive.   If  4mindex224m  is  omitted  then  it  defaults  to  4mindex124m.
              Attempts to delete a tear-off menu entry are  ignored  (instead,
              you  should  change  the  1mtearOff  22moption to remove the tear-off
              entry).

       4mpathName24m 1mentrycget 4m22mindex24m 4moption0m
              Returns the current value of  a  configuration  option  for  the
              entry  given  by  4mindex24m.   4mOption24m  may  have  any  of the values
              accepted by the 1madd 22mwidget command.

       4mpathName24m 1mentryconfigure 4m22mindex24m ?4moptions24m?
              This command is similar to the 1mconfigure 22mcommand, except that it
              applies  to the options for an individual entry, whereas 1mconfig-0m
              1mure 22mapplies to the options for the menu as a whole.  4mOptions24m may
              have  any  of the values accepted by the 1madd 22mwidget command.  If
              4moptions24m are specified, options are modified as indicated in  the
              command  and the command returns an empty string.  If no 4moptions0m
              are specified, returns a list describing the current options for
              entry  4mindex24m (see 1mTk_ConfigureInfo 22mfor information on the format
              of this list).

       4mpathName24m 1mindex 4m22mindex0m
              Returns the numerical index corresponding to 4mindex24m, or  1mnone  22mif
              4mindex24m was specified as 1mnone22m.

       4mpathName24m 1minsert 4m22mindex24m 4mtype24m ?4moption24m 4mvalue24m 4moption24m 4mvalue24m 4m...24m?
              Same  as  the  1madd 22mwidget command except that it inserts the new
              entry just before the entry given by 4mindex24m, instead of appending
              to  the  end of the menu.  The 4mtype24m, 4moption24m, and 4mvalue24m arguments
              have the same interpretation as for the 1madd 22mwidget command.   It
              is  not  possible to insert new menu entries before the tear-off
              entry, if the menu has one.

       4mpathName24m 1minvoke 4m22mindex0m
              Invoke the action of the menu entry.  See the  sections  on  the
              individual  entries  above  for details on what happens.  If the
              menu entry is disabled then nothing happens.  If the entry has a
              command  associated  with  it then the result of that command is
              returned as the result of the 1minvoke 22mwidget command.   Otherwise
              the  result  is  an  empty string.  Note:  invoking a menu entry
              does not automatically unpost the menu;   the  default  bindings
              normally  take  care  of  this before invoking the 1minvoke 22mwidget
              command.

       4mpathName24m 1mpost 4m22mx24m 4my0m
              Arrange for the menu to be displayed on the screen at the  root-
              window  coordinates  given  by  4mx24m  and 4my24m.  These coordinates are
              adjusted if necessary to guarantee that the entire menu is visi-
              ble  on  the  screen.   This  command  normally returns an empty
              string.  If the 1mpostCommand 22moption has been specified, then  its
              value  is  executed  as a Tcl script before posting the menu and
              the result of that script is returned as the result of the  1mpost0m
              widget  command.   If  an error returns while executing the com-
              mand, then the error is returned without posting the menu.

       4mpathName24m 1mpostcascade 4m22mindex0m
              Posts the submenu associated with the  cascade  entry  given  by
              4mindex24m,  and  unposts  any  previously  posted submenu.  If 4mindex0m
              doesn't correspond to a cascade  entry,  or  if  4mpathName24m  isn't
              posted, the command has no effect except to unpost any currently
              posted submenu.

       4mpathName24m 1mtype 4m22mindex0m
              Returns the type of the menu entry given by 4mindex24m.  This is  the
              4mtype24m  argument  passed  to the 1madd 22mwidget command when the entry
              was created, such as 1mcommand 22mor  1mseparator22m,  or  1mtearoff  22mfor  a
              tear-off entry.

       4mpathName24m 1munpost0m
              Unmap the window so that it is no longer displayed.  If a lower-
              level cascaded menu is posted, unpost  that  menu.   Returns  an
              empty  string.  This subcommand does not work on Windows and the
              Macintosh, as those platforms have their own  way  of  unposting
              menus.

       4mpathName24m 1myposition 4m22mindex0m
              Returns a decimal string giving the y-coordinate within the menu
              window of the topmost pixel in the entry specified by 4mindex24m.


1mMENU CONFIGURATIONS0m
       The default bindings support four different ways of using menus:

       1mPulldown Menus in Menubar0m
              This is the most command case. You create  a  menu  widget  that
              will  become  the menu bar. You then add cascade entries to this
              menu, specifying the pull down menus you wish  to  use  in  your
              menu  bar.  You  then create all of the pulldowns. Once you have
              done this, specify the  menu  using  the  1m-menu  22moption  of  the
              toplevel's  widget  command.  See  the 1mtoplevel 22mmanual entry for
              details.

       1mPulldown Menus in Menu Buttons0m
              This is the compatable way to do  menu  bars.   You  create  one
              menubutton  widget  for  each  top-level menu, and typically you
              arrange a series of menubuttons in a row in  a  menubar  window.
              You  also  create the top-level menus and any cascaded submenus,
              and tie them together with 1m-menu 22moptions in menubuttons and cas-
              cade  menu  entries.   The top-level menu must be a child of the
              menubutton, and each submenu must be a child of  the  menu  that
              refers  to  it.   Once  you have done this, the default bindings
              will allow users to traverse and invoke the tree  of  menus  via
              its menubutton;  see the 1mmenubutton 22mmanual entry for details.

       1mPopup Menus0m
              Popup  menus  typically post in response to a mouse button press
              or keystroke.  You create the popup menus and any cascaded  sub-
              menus,  then  you call the 1mtk_popup 22mprocedure at the appropriate
              time to post the top-level menu.

       1mOption Menus0m
              An option menu consists of a menubutton with an associated  menu
              that  allows  you  to select one of several values.  The current
              value is displayed in the menubutton and is  also  stored  in  a
              global  variable.   Use  the  1mtk_optionMenu  22mprocedure to create
              option menubuttons and their menus.

       1mTorn-off Menus0m
              You create a torn-off menu by invoking the tear-off entry at the
              top of an existing menu.  The default bindings will create a new
              menu that is a copy of the original menu  and  leave  it  perma-
              nently  posted as a top-level window.  The torn-off menu behaves
              just the same as the original menu.


1mDEFAULT BINDINGS0m
       Tk automatically creates class bindings for menus that  give  them  the
       following default behavior:

       [1]    When  the  mouse  enters  a menu, the entry underneath the mouse
              cursor activates;  as the  mouse  moves  around  the  menu,  the
              active entry changes to track the mouse.

       [2]    When  the  mouse  leaves  a  menu all of the entries in the menu
              deactivate, except in the special case  where  the  mouse  moves
              from a menu to a cascaded submenu.

       [3]    When a button is released over a menu, the active entry (if any)
              is invoked.  The menu also unposts unless it is a torn-off menu.

       [4]    The Space and Return keys invoke the active entry and unpost the
              menu.

       [5]    If any of the entries in a menu  have  letters  underlined  with
              with 1m-underline 22moption, then pressing one of the underlined let-
              ters (or its upper-case or lower-case equivalent)  invokes  that
              entry and unposts the menu.

       [6]    The  Escape  key  aborts  a  menu  selection in progress without
              invoking any entry.  It also unposts the menu  unless  it  is  a
              torn-off menu.

       [7]    The  Up and Down keys activate the next higher or lower entry in
              the menu.  When one end of the menu is reached, the active entry
              wraps around to the other end.

       [8]    The Left key moves to the next menu to the left.  If the current
              menu is a cascaded submenu, then the submenu is unposted and the
              current  menu entry becomes the cascade entry in the parent.  If
              the current menu is a top-level menu posted from  a  menubutton,
              then  the current menubutton is unposted and the next menubutton
              to the left is posted.  Otherwise the key has  no  effect.   The
              left-right  order of menubuttons is determined by their stacking
              order:  Tk assumes that the lowest menubutton (which by  default
              is the first one created) is on the left.

       [9]    The  Right key moves to the next menu to the right.  If the cur-
              rent entry is a cascade entry, then the submenu  is  posted  and
              the   current menu entry becomes the first entry in the submenu.
              Otherwise, if the current menu was  posted  from  a  menubutton,
              then  the current menubutton is unposted and the next menubutton
              to the right is posted.

       Disabled menu entries are non-responsive:  they don't activate and they
       ignore mouse button presses and releases.

       The behavior of menus can be changed by defining new bindings for indi-
       vidual widgets or by redefining the class bindings.


1mBUGS0m
       At present it isn't possible to use the option database to specify val-
       ues for the options to individual entries.


1mKEYWORDS0m
