DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

VxSpinButton(1vtcl)


VxSpinButton -- create a SpinButton, return widget name of enclosing form widget

Synopsis

VxSpinButton widget width lower underCB upper overCB \
increment default userCB position upOp dnOP

Description

Creates a SpinButton called widget, which consists of a text field and two buttons which increase and decrease the numeric value in the text field within upper and lower bounds.

Arguments

All arguments to VxSpinButton except upOp and dnOp are mandatory. Arguments may be specified as blank strings, and must appear in this order:

widget
The name of the SpinButton widget.

width
The width, in columns, of the text component of the SpinButton.

lower
The lower boundary value.

underCB
A callback for when the value goes below the lower bound. If set to "``'', the package automatically wraps the value around to the upper value.

upper
The upper boundary value.

overCB
A callback for when the value goes over the upper bound. If set to ``'', the package automatically wraps the value around to the lower value.

increment
Sets how much the value increases or decreases each time the button is pressed.

default
The initial default value.

userCB
A callback which validates the value of the text component of the SpinButton. Specify ``'' for no callback.

position
A list containing any geometry arguments for the SpinButton.

upOp
Optional operation to perform on increment when the ``up'' button is pressed (+ if not present).

dnOp
Optional operation to perform on increment when the ``down'' button is pressed (- if not present).

Globals


SBlower
array of lower boundary values, indexed by widget.

SBupper
array of upper boundary values, indexed by widget.

Return values

If successful, the VxSpinButton command returns the name of the enclosing form widget (the name of the SpinButton widget).

Examples

   proc CreateSpin {form} {
   	set spin [VxSpinButton spin 15 0 "" 100 "" 2 50 "" "" + -]
   

# widget name = spin # width = 15 # lower bound = 0 # lower callback = blank ("") # upper bound = 100 # upper callback = blank ("") # increment = 2 # default value = 50 # user callback = blank ("") # position = blank ("") # up operation = + (default, may be omitted) # down operation = - (default, may be omitted) }

set app [VtOpen Spin]

set mainform [VtFormDialog $app.form -title "Spin button example"]

CreateSpin $mainform

VtShow $mainform VtMainLoop

Notices

The component widgets names are attached to the spinbutton name returned (given a SpinButton name in $sb):
25 April 2004
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004