hwtk::scalerange

Create and manipulate a scale range widget.

Format

hwtk::scalerange - pathName ?option value? …

Description

A hwtk::scalerange widget is used to select a range of values. A scale displays a start range select slider and an end range select slider both of which can be moved along over a trough, with the relative position of the sliders over the trough indicating the values.

Standard Options

-clientdata
Database name: clientData
Database class: ClientData
Acts as a data storage for a widgets. User can store any data and this will not have any effect on widget property.
-state
Database name: state
Database class: State
May be set to normal or disabled to control the disabled state bit.

Widget-Specific Options

-command ?command?
Specifies the prefix of a Tcl command to invoke whenever the scale’s value is changed via a widget command. The actual command consists of this option followed by a space and a real number indicating the new value of the scale.
-from ?value?
Beginning value for the scale. Without argument, returns the current from value. Default is 0.
-showruler ?value?
Display ruler tickmarks for scale. Values are 1 or 0. Default is 1.
-step ?value?
Sets the increment between the ruler tickmarks. Without argument, returns the current step value.
-to ?value?
Specifies the maximum value on the scale. Without argument, returns the current to value. Default is 100.

Widget Command

pathName configure ?option? ?value option value …?
Query or modify the configuration options of the widget. 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. If option is specified with no value, then the command returns a list describing the named option: the elements of the list are the option name, database name, database class, default value, and current value. If no option is specified, returns a list describing all of the available options for pathName.
pathName cget option
Returns the current value of the configuration option given by option.
pathName identify element x y
Returns the name of the element under the point given by x and y, or an empty string if the point does not lie within any element. x and y are pixel coordinates relative to the widget. Some widgets accept other identify subcommands.
pathName instate statespec ?script?
Test the widget’s state. If script is not specified, returns 1 if the widget state matches statespec and 0 otherwise. If script is specified, equivalent to
if{[pathNameinstatestateSpec]}script
pathName state ?stateSpec?
Modify or inquire widget state. If stateSpec is present, sets the widget state: for each flag in stateSpec, sets the corresponding flag or clears it if prefixed by an exclamation point. Returns a new state spec indicating which flags were changed:
setchanges[pathNamestatespec]
pathNamestate$changes
will restore pathName to the original state. If stateSpec is not specified, returns a list of the currently-enabled state flags.
pathName endrange ?value?
With no arguments, returns current selected maximum value of the scale. With value, sets maximum selected value on the scale. Default is 100.0.
pathName startrange ?value?
With no arguments, returns current selected minimum value of the scale. With value, sets minimum selected value on the scale. Default is 0.0.

Example

hwtk::dialog .dlg -title "::hwtk::scalerange"

set w [.dlg recess]

hwtk::scalerange $w.s -from 1 -to 10 
$w.s configure -step 1
$w.s startrange 3
$w.s endrange 6
pack $w.s

.dlg post