HyperWorks Tools

hwtk::checkbutton

hwtk::checkbutton

Previous topic Next topic No expanding text in this topic  

hwtk::checkbutton

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

NAME

hwtk::checkbutton - On/off widget

 

DESCRIPTION

A hwtk::checkbutton widget is used to show or change a setting. It has two states, selected and deselected. The state of the checkbutton may be linked to a Tcl variable.

hwtk::checkbutton

 

CLASS DIAGRAM

::hwtk::widget::HWCheckbutton::hwtk::interface::HWIButton::hwtk::interface::HWIWidget::hwtk::interface::HWIBase::itk::Archetypedigraph HWCheckbutton { layout = "dot"; rankdir = LR; ratio = "compress"; edge [color="#333333"] node [shape=rect, style="rounded,filled", fontname="sans-serif, serif", color="#000000", fillcolor="#FCFFF6", penwidth=0.5]; Archetype [label="Archetype", fillcolor="#FFF5FF", tooltip="::itk::Archetype", URL="../_auto/architecture.html"]; HWIBase [label="HWIBase", fillcolor="#E0FFFF", tooltip="::hwtk::interface::HWIBase", ]; HWIWidget [label="HWIWidget", fillcolor="#E0FFFF", tooltip="::hwtk::interface::HWIWidget", ]; HWIButton [label="HWIButton", fillcolor="#E0FFFF", tooltip="::hwtk::interface::HWIButton", ]; HWCheckbutton [label="HWCheckbutton", fillcolor="#FFEAD8", tooltip="::hwtk::widget::HWCheckbutton", URL="checkbutton.html"]; Archetype -> HWIBase; HWIBase -> HWIWidget; HWIWidget -> HWIButton; HWIButton -> HWCheckbutton; }

SYNOPSIS

hwtk::checkbutton - pathName ?option value? ...

 

STANDARD OPTIONS

-clientdata, clientData, ClientData

-compound, compound, Compound

-help, help, Text

-helpcommand, helpcommand, Command

-image, image, Image

-state, state, State

-text, text, Text

-textvariable, textVariable, Variable

-underline, underline, Underline

-width, width, Width

 

WIDGET-SPECIFIC OPTIONS

 

Command-Line Name: -command

Database Name: command

Database Class: Command

A script to evaluate when the widget is invoked.

 

Command-Line Name: -offvalue

Database Name: offValue

Database Class: OffValue

The value to store in the associated -variable when the widget is deselected. Defaults to 0.

 

Command-Line Name: -onvalue

Database Name: onValue

Database Class: OnValue

The value to store in the associated -variable when the widget is selected. Defaults to 1.

 

Command-Line Name: -variable

Database Name: variable

Database Class: Variable

The name of a global variable whose value is linked to the widget. Defaults to the widget pathname if not specified.

 

WIDGET COMMANDS

In addition to the standard configure, cget, identify, instate, and state commands, checkbutton support the following additional widget commands:

pathName invoke

Toggles between the selected and deselected states and evaluates the associated -command. If the widget is currently selected, sets the -variable to the -offvalue and deselects the widget; otherwise, sets the -variable to the -onvalue. Returns the result of the -command.

 

EXAMPLES

::hwtk::dialog .d -title "::hwtk::checkbutton"

set f [.d recess]

 

array set state {wipers 1 brakes 0 driver 1}

 

hwtk::checkbutton $f.ck1 -text "Wipers OK" -help "Select safety item - wipers" -variable state(wipers)

hwtk::checkbutton $f.ck2 -text "Brakes OK" -help "Select safety item - brakes" -variable state(brakes)

hwtk::checkbutton $f.ck3 -text "Driver sober" -help "Select safety item - driver state" -variable state(driver)

 

grid $f.ck1 -sticky w

grid $f.ck2 -sticky w

grid $f.ck3 -sticky w

 

.d post