Documentation‎ > ‎Entries‎ > ‎

    gnocl::spinButton

    A widget which allows the user to input a number.

    Synopsis

    gnocl::spinButton [-option value...]

    Screenshot

    Options

    -data string
    User defined data which can be retrieved via the cget subcommand.
    -digits integer (default: 1)
    The number of decimal places to display.
    -editable boolean (default: true)
    Whether the the spinButton is editable.
    -hasFocus 1
    This sets the focus to the widget. To unset the focus it must be set to another widet.
    -heightGroup string (default: "")
    The -heightGroup option can be an arbitrary string. All widgets with the same heightGroup request the same height. If packed with the fill flag set, they will have nevertheless different heights.
    -lower float (default: 0)
    The lower limit of the spinButton.
    -maxLength integer (default: -1)
    Maximum length of entry value (-1 means not limited).
    -name string
    Name of the widget, can be used to set options in an rc file.
    -numeric boolean (default: 1)
    Whether non-numeric characters should be ignored.
    -onShowHelp  string (default: "")
    Tcl command which is executed in the global scope if the "show-help" signal is received, which is normally the case if the user presses F1 or Ctrl-F1. Before evaluation the following percent strings are substituted:

    %w    widget name
    %h    help type: either "whatsThis" or "tooltip"
    -onValueChanged string (default: "")
    Tcl command which is executed if the spinButton changes its value. Before evaluation the following percent strings are substituted:

    %w    widget name
    %v    current value
    -pageInc float (default: 10)
    The increment to use to make major changes to the value.
    -sensitive boolean (default: 1)
    Whether or not the item is sensitive to user input.
    -sizeGroup string (default: "")
    The -sizeGroup option can be an arbitrary string. All widgets with the same sizeGroup request the same size. If packed with the fill flag set, they will have nevertheless different sizes.
    -stepInc float (default: 1)
    The increment to use to make minor changes to the value.
    -tooltip string
    Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.
    -upper float (default: 100)
    The upper limit of the spinButton.
    -value float (default: 0)
    The value of the spinButton.
    -variable  string (default: "") float
    Name of a (global) variable which is changed whenever the spinButton is changed.
    -visible boolean (default: 1)
    Whether or not the item is visible.
    -widthGroup string (default: "")
    The -widthGroup option can be an arbitrary string. All widgets with the same widthGroup request the same width. If packed with the fill flag set, they will have nevertheless different widths.
    -wrap boolean (default: 0)
    Whether the spinButton wraps upon reaching its limits.

    Description

    A spinButton 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 spin [gnocl::spinButton \
         -upper 50 \
        -variable var \
        -onValueChanged {puts "value is now %v == $var"}]

    gnocl::window \
        -title "SpinButton" \
        -child $spin


    Comments

    Sections