#
Prev |  | Next

# scale

## Name

scale -- A slider widget for selecting a value from a range.

## Synopsis

scale [`-option` `value`...]

## Screenshot

## Options

-data

  type: string

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

-digits

  type: integer (default: 1)

  The number of decimal places to display. If set to 0 the value of the scale will be returned as integer.

-drawValue

  type: boolean (default: 1)

  Whether to draw the value at one side of the slider.

-hasFocus

  type: 1

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

-inverted

  type: boolean (default: 1)

  Whether the minimum and maximum are swapped.

-lower

  type: float (default: 0)

  The lower limit of the scale.

-name

  type: string

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

-onRealize

  type: string (default: "")

  Tcl command whih is executed in the global scope if the widget has been realized. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name. TABLE

-onShowHelp

  type: string (default: "")

  Tcl command 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 TABLE %% | % %w | widget name %h | help type: either "whatsThis" or "tooltip" TABLE

-onValueChanged

  type: string (default: "")

  Tcl command which is executed if the scale changes its value. Before evaluation the following percent strings are substituted: TABLE %% | % %w | widget name %v | current value /TABLE

-orientation

  type: ONEOF vertical, horizontal (default: vertical)

  Orientation of the slider. This cannot be changed after creation.

-pageInc

  type: float (default: 10)

  The increment to use to make major changes to the value.

-sensitive

  type: boolean (default: 1)

  Whether or not the item is sensitve to user input.

-stepInc

  type: float (default: 1)

  The increment to use to make minor changes to the value.

-tooltip

  type: string

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

-updatePolicy

  type: ONEOF continuous discontinuous delayed (default: continuous)

  Determines when the associated variable is changed and command executed.

-upper

  type: float (default: 100)

  The upper limit of the scale.

-value

  type: float (default: 0)

  The value of the scale.

-valuePos

  type: ONEOF top, bottom, left, right (default: top)

  At which side of the slider the value is drawn.

-variable

  type: string (default: "")

  Name of a (global) variable which is changed whenever the scale is changed.

-visible

  type: boolean (default: 1)

  Whether or not the item is visible.

## Description

A scale widgets lets the user input numerical values. If digits is zero, the value is an integer, else it is a float.

## 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` onValueChanged

  Executes the associated command.

## Example

    set scale [gnocl::scale -orientation horizontal -digits 0 -variable var -onValueChanged {puts "value is now %v == $var"} -value 32]
    gnocl::window -title "Scale" -child $scale

results in

## See also

spinButton, `GtkScale`

Prev | Home | Next
comboEntry | Up | spinButton