#
Prev |  | Next

# checkButton

## Name

checkButton -- A widget which changes between two states when clicked.

## Synopsis

checkButton [`-option` `value`...]

## Screenshot

## Options

-active

  type: boolean (default: 0)

  Whether the widget is active.

-activeBackgroundColor

  type: color

  Background color. DISCLAIMER_COLOR

-data

  type: string

  User defined data which can be retrieved via the cget subcommand.

-hasFocus

  type: 1

  This sets the focus to the widget. To unset the focus it must be set to another widet.

-indicatorOn

  type: boolean (default: true)

  Determines whether or not the toggle button is drawn on screen

-name

  type: string

  Name of the widget, can be used to set options in an rc file.

-normalBackgroundColor

  type: color

  Background color. DISCLAIMER_COLOR

-offValue

  type: string (default: 0)

  Value to store in the button's associated variable whenever this button is not selected

-onButtonPress

  type: string (default: "")

  Tcl script which is executed if a mouse button is press inside the widget.

  Before evaluation the following percent strings are substituated:

| %w | widget name of the parent the handlebox
| %t | type of event. One of buttonPress, button2Press or button3Press
| %x | x coordinate
| %y | y coordinate
| %b | button number
| %s | state of the buttons and modifiers (bitmask)

-onButtonRelease

  type: string (default: "")

  Tcl script which is executed if a mouse button is released inside the widget.

  Before evaluation the following percent strings are substituated:

| %w | widget name of the parent the handlebox
| %t | type of event. One of buttonPress, button2Press or button3Press
| %x | x coordinate
| %y | y coordinate
| %b | button number
| %s | state of the buttons and modifiers (bitmask)

-onPopupMenu

  type: string (default: "")

  Tcl script which is executed if the "popup-menu" signal is recieved, which is normally the case if the user presses Shift-F10.

  Before evaluation the following percent strings are substituated:

| %w | widget name.

-onShowHelp

  type: string (default: "")

  Tcl script which is executed in the global scope if the "show-help" signal is recieved, which is normally the case if the user presses F1 or Ctrl-F1.

  Before evaluation the following percent strings are substituated:

| %w | widget name
| %h | help type: either "whatsThis" or "tooltip".

-onToggled

  type: string (default: "")

  Tcl script which is executed if the radio button is toggled.

  Before evaluation the following percent strings are substituted:

| %w | widget name of the parent the handlebox
| %v | onValue or offValue depending of the state

-onValue

  type: string (default: 1)

  Value to store in the button's associated variable whenever this button is selected

-prelightBackgroundColor

  type: color

  Background color. DISCLAIMER_COLOR

-relief

  type: ONEOF normal, half, none (default: normal)

  Relief of the button.

-sensitive

  type: boolean (default: 1)

  Whether or not the item is sensitve to user input.

-text

  type: percent-string (default: "")

  Text or icon of the button

-tooltip

  type: string

  Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.

-variable: string

  type: 0

  Name of a (global) variable which is changed when the state of the button changes.

-visible

  type: boolean (default: 1)

  Whether or not the item is visible.

## Description

A check button widget has two states: on and off. If the state is changed, it executes a command and sets a tcl variable appropriately.

## Commands

`id` cget `option`

  Returns the value for one option. The option may have any of the values accepted by configure.

`id` configure [`-option` `value`...]

  Configures the widget. Option may have any of the values accepted on creation of the widget.

`id` delete

  Deletes the widget and the associated tcl command.

`id` onToggled

  Invoke the Tcl command associated with the check button if there is one. This command is ignored if the button's state is not sensitive.

## Example

    set but [gnocl::checkButton -text "%__Status" -onValue "ok" -offValue "danger" -variable status]
    gnocl::window -title "Check Button" -child $but

results in

## See also

button, radioButton, `GtkCheckButton`

Prev | Home | Next
button | Up | comboBox