menubutton(n)		     Ck Built-In Commands		 menubutton(n)



______________________________________________________________________________

NAME
       menubutton - Create and manipulate menubutton widgets

SYNOPSIS
       menubutton pathName ?options?

STANDARD OPTIONS
       activeAttributes		     attributes	    disabledForegroundtextVariable
       activeBackground		     background	    foregroundunderline
       activeForeground		     disabledAttributestakeFocusunderlineAttributes
       anchor	      disabledBackground	    textunderlineForeground

       See the ``options'' manual entry for details on the standard options.

WIDGET-SPECIFIC OPTIONS
       Name:	       height
       Class:	       Height
       Command-Line Switch:-height

	      Specifies	 a  desired height for the menubutton in screen lines.
	      If this option isn't specified, the menubutton's desired	height
	      is 1 line.

       Name:	       indicatorForeground
       Class:	       IndicatorForeground
       Command-Line Switch:-indicatorforeground

	      Color  in	 which	the indicator rectangle, if any, is drawn.  On
	      color terminals this defaults to red, on monochrome terminals to
	      white.

       Name:	       indicatorOn
       Class:	       IndicatorOn
       Command-Line Switch:-indicatoron

	      The  value must be a proper boolean value.  If it is true then a
	      small indicator rectangle will be displayed on the right side of
	      the  menubutton and the default menu bindings will treat this as
	      an option menubutton.  If false then no indicator will  be  dis-
	      played.

       Name:	       menu
       Class:	       MenuName
       Command-Line Switch:-menu

	      Specifies	 the  path  name  of  the  menu	 associated  with this
	      menubutton.  The menu must be a child of the menubutton.

       Name:	       state
       Class:	       State
       Command-Line Switch:-state

	      Specifies one of	three  states  for  the	 menubutton:   normal,
	      active,  or  disabled.   In  normal state the menubutton is dis-
	      played using the attributes, foreground, and background options.
	      The  active  state  is typically used when the input focus is in
	      the menubutton.  In active state	the  menubutton	 is  displayed
	      using  the  activeAttributes,  activeForeground, and activeBack-
	      ground options.  Disabled state means that the menubutton should
	      be insensitive: the default bindings will refuse to activate the
	      widget and will ignore mouse button presses.  In this state  the
	      disabledAttributes,  disabledForeground,	and disabledBackground
	      options determine how the button is displayed.

       Name:	       width
       Class:	       Width
       Command-Line Switch:-width

	      Specifies a desired width for the menubutton in screen  columns.
	      If  this	option isn't specified, the menubutton's desired width
	      is computed from the size of the text being displayed in it.
_________________________________________________________________


INTRODUCTION
       The menubutton command creates a new  window  (given  by	 the  pathName
       argument)  and  makes it into a menubutton widget.  Additional options,
       described above, may be specified on the command line or in the	option
       database	 to  configure	aspects	 of the menubutton such as its colors,
       attributes, and text.  The  menubutton  command	returns	 its  pathName
       argument.   At the time this command is invoked, there must not exist a
       window named pathName, but pathName's parent must exist.

       A menubutton is a widget that displays a textual string and is  associ-
       ated  with  a  menu  widget.   One  of the characters may optionally be
       underlined using the underline, underlineAttributes, and underlineFore-
       ground  options.	  In  normal  usage,  pressing mouse button 1 over the
       menubutton causes the associated menu to be posted just underneath  the
       menubutton.

       There  are several interactions between menubuttons and menus;  see the
       menu manual entry for information on various menu configurations,  such
       as pulldown menus and option menus.


WIDGET COMMAND
       The  menubutton	command	 creates a new Tcl command whose name is path-
       Name.  This command may be used to invoke  various  operations  on  the
       widget.	 It  has  the following general form: pathName option ?arg arg
       ...?  Option and the args determine the exact behavior of the  command.
       The following commands are possible for menubutton widgets:

       pathName cget option
	      Returns  the  current value of the configuration option given by
	      option.  Option may have any  of	the  values  accepted  by  the
	      menubutton command.

       pathName configure ?option? ?value option value ...?
	      Query  or modify the configuration options of the widget.	 If no
	      option is specified, returns a list describing all of the avail-
	      able options for pathName. If option is specified with no value,
	      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 option  is  specified).   If	 one  or  more
	      option-value  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.  Option may have any of the
	      values accepted by the menubutton command.


DEFAULT BINDINGS
       Ck automatically creates class bindings for menubuttons that give  them
       the following default behavior:

       [1]    A	 menubutton  activates	whenever  it  gets the input focus and
	      deactivates whenever it loses the input focus.

       [2]    Pressing mouse button 1 over a menubutton posts the  menubutton:
	      its associated menu is posted under the menubutton.  Once a menu
	      entry has been invoked, the menubutton unposts itself.

       [3]    When a menubutton is posted,  its	 associated  menu  claims  the
	      input focus to allow keyboard traversal of the menu and its sub-
	      menus.  See the menu manual entry for details on these bindings.

       [4]    The F10 key may be  typed	 in  any  window  to  post  the	 first
	      menubutton under its toplevel window that isn't disabled.

       [5]    If  a  menubutton has the input focus, the space and return keys
	      post the menubutton.

       If the menubutton's state is disabled then none of  the	above  actions
       occur:  the menubutton is completely non-responsive.

       The behavior of menubuttons can be changed by defining new bindings for
       individual widgets or by redefining the class bindings.


KEYWORDS
       menubutton, widget



Ck				      8.0			 menubutton(n)
