Pike v8.1 release 6

Class GTK2.SpinButton

Inheritance graph
Description

The Spin Button widget is generally used to allow the user to select a value from a range of numeric values. It consists of a text entry box with up and down arrow buttons attached to the side. Selecting one of the buttons causes the value to "spin" up and down the range of possible values. The entry box may also be edited directly to enter a specific value.

The Spin Button allows the value to have zero or a number of decimal places and to be incremented/decremented in configurable steps. The action of holding down one of the buttons optionally results in an acceleration of change in the value according to how long it is depressed.

The Spin Button uses an W(Adjustment) object to hold information about the range of values that the spin button can take.

The attributes of an W(Adjustment) are used by the Spin Button in the following way: <ul><li>value: initial value for the Spin Button</li> <li>lower: lower range value</li> <li>upper: upper range value</li> <li>step_increment: value to increment/decrement when pressing mouse button 1 on a button</li> <li>page_increment: value to increment/decrement when pressing mouse button 2 on a button</li> <li>page_size: unused</li> </ul>

The argument order for the W(Adjustment) constructor is: value, lower, upper, step_increment, page_increment, page_size

 GTK2.SpinButton(GTK2.Adjustment(),0.1, 1 )->set_size_request(60,20)

Properties: GTK2.Adjustment adjustment float climb-rate int digits int numeric int snap-to-ticks int update-policy float value int wrap

Style properties: int shadow-type

Signals: change_value

input

output

value_changed


Inherit CellEditable

inherit GTK2.CellEditable : CellEditable


Inherit Editable

inherit GTK2.Editable : Editable


Inherit Entry

inherit GTK2.Entry : Entry


Method create

GTK2.SpinButton GTK2.SpinButton(GTK2.Adjustment range_or_min_or_props, float climb_rate_or_max, int|float precision_or_step)

Description

The climb_rate argument take a value between 0.0 and 1.0 and indicates the amount of acceleration that the Spin Button has. The digits argument specifies the number of decimal places to which the value will be displayed.