NAME
Button - a button widget with added dynamic help, drag and drop, and easy internationalization (i18n)
SYNOPSIS
Button pathName ?option value...?
DESCRIPTION
STANDARD OPTIONS
Not themed
-activebackground
-activeforeground
-anchor
-background or -bg
-bitmap
-borderwidth or -bd
-cursor
-disabledforeground
-font
-foreground or -fg
-highlightbackground
-highlightcolor
-highlightthickness
-image
-justify
-padx
-pady
-repeatdelay
-repeatinterval
-takefocus
-text
-textvariable
-wraplength
Themed
-compound
-cursor
-image
-style
-repeatdelay
-repeatinterval
-takefocus
-text
-textvariable
WIDGET-SPECIFIC OPTIONS
-armcommand
-command
-default
-disarmcommand
-height
-helptext
-helptype
-helpvar
-name
-relief
-state
-underline
-width
WIDGET COMMAND
pathName cget option
pathName configure ?option? ?value option value ...?
pathName invoke

NAME

Button - a button widget with added dynamic help, drag and drop, and easy internationalization (i18n)

SYNOPSIS

Button pathName ?option value...?

DESCRIPTION

The Slab Button widget extends the Tk button with new options. DynamicHelp options, a new relief style, -armcommand and -disarmcommand callbacks, and -repeatdelay, -repeatinterval options have been added.

The Button widget is used by Slab ButtonBox and therefore by Dialog and its derivatives MessageDlg, PasswdDlg, ProgressDlg, SelectColor and SelectFont.

WIDGET-SPECIFIC OPTIONS

-armcommand
Specifies a Tcl command to associate with the Button when mouse button 1 is pressed over the Button. When -repeatdelay or -repeatinterval option is positive integer, this command is repeatedly called if mouse pointer is over the Button and until mouse button 1 is released.
-command
Specifies a Tcl command to associate with the Button. This command is typically invoked when mouse button 1 is released over the Button window.
-default
Specifies one of three states for the default ring: normal, active, or disabled. In the active state, the button is drawn with the platform-specific appearance for a default button. In the normal state, the button is drawn with the platform specific appearance for a non-default button, leaving enough space to draw the default button appearance. The normal and active states will result in buttons of the same size. In the disabled state, the button is drawn with the non-default button appearance without leaving space for the default appearance. The disabled state may result in a smaller button than the active state.
-disarmcommand
Specifies a Tcl command to associate with the Button when mouse button 1 is released. This command is called even if pointer is not over the Button, and always before the command specified by -command option. It is typically used in conjuntion with -armcommand, -repeatdelay and -repeatinterval.
-height
Specifies a desired height for the Button. If an image or bitmap is being displayed in the Button then the value is in screen units; for text it is in lines of text. If this option is not specified, the Button's desired height is computed from the size of the image or bitmap or text being displayed in it.
This option is not available when the widget is themed.
-helptext
Text for dynamic help. If empty, no help is available for this widget. See also DynamicHelp.
-helptype
Type of dynamic help. Use balloon or variable. See also DynamicHelp.
-helpvar
Variable to use when -helptype option is variable. See also DynamicHelp.
-name
Specifies a name name for the Button. If the key nameName is found in the module Slab::lang::code where code identifies the msgcat locale, then the values for the -text and -underline options are obtained from the value assigned to that key by the module.
-relief
Specifies the 3-D effect desired for the widget. Acceptable values are standard values for button relief (raised, sunken, flat, ridge, solid, and groove) and link, which specifies that button relief is flat when pointer is outside the button and raised when pointer is inside.
This option has only the following effect if the widget is themed: The value link uses a style Toolbutton while any other value uses the standard effect.
-state
Specifies one of three states for the Button: normal, active, or disabled. In the normal state the Button is displayed using the -foreground and -background options. The active state is typically used when the pointer is over the Button. In the active state the Button is displayed using the -activeforeground and -activebackground options. The disabled state means that the Button should be unresponsive: the default bindings will refuse to activate and the widget will ignore mouse button presses. In this state the -disabledforeground and -background options determine how the Button is displayed.
-underline
Specifies the integer index of a character to underline in the label of the button. 0 corresponds to the first character of the text displayed, 1 to the next character, and so on. A value of -1 in Tk 8, or {} in Tk 9, indicates that no character is underlined.
The binding <Alt-char> is automatically set on the toplevel of the Button to call Button::setfocus.
-width
If an image or bitmap is being displayed in the Button then the value is in screen units; for text it is in characters. If this option is not specified, the Button's desired width is computed from the size of the image or bitmap or text being displayed in it.

WIDGET COMMAND

pathName cget option
Returns the current value of the configuration option given by option. Argument option may have any of the values accepted by the creation command Button.
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 available 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. Argument option may have any of the values accepted by the creation command Button. Read-only options cannot be modified.
pathName invoke
If Button state is not disabled, this command invokes the commands of the Button. The Button is redisplayed with the active colors and sunken -relief, and the -armcommand is called. Then the Button is redisplayed with its normal color and its defined -relief, and the -disarmcommand and then the -command are called.

The invoke command is called when the Button has keyboard focus and the user presses the space bar.

BINDINGS

<<Invoke>>
This event is bound to the invoke widget command.
Copyright © 1998-1999 UNIFIX.
Copyright © 2001-2002 ActiveState Corp.
Copyright © 2017-2025 CitizenEarth Internet Ltd.