11.110Class GtkSpinButton

Retrieve an integer or floating-point number from the user

Class GtkSpinButton( adjustment, climb_rate, digits )
adjustment a GtkAdjustment, or nil.
climb_rate the new climb rate.
digits the number of decimal places to display in the spin button.

A GtkSpinButton is an ideal way to allow the user to set the value of some attribute. Rather than having to directly type a number into a GtkEntry, GtkSpinButton allows the user to click on one of two arrows to increment or decrement the displayed value. A value can still be typed in, with the bonus that it can be checked to ensure it is in a given range.

The main properties of a GtkSpinButton are through a GtkAdjustment. See the GtkAdjustment section for more details about an adjustment's properties.

[...]

Methods
configureChanges the properties of an existing spin button.
get_adjustmentGet the adjustment associated with a GtkSpinButton
get_digitsFetches the precision of spin_button.
get_incrementsGets the current step and page the increments used by spin_button.
get_numericReturns whether non-numeric text can be typed into the spin button.
get_rangeGets the range allowed for spin_button.
get_snap_to_ticksReturns whether the values are corrected to the nearest step.
get_update_policyGets the update behavior of a spin button. See gtk_spin_button_set_update_policy().
get_valueGet the value in the spin_button.
get_value_as_intGet the value spin_button represented as an integer.
get_wrapReturns whether the spin button's value wraps around to the opposite limit when the upper or lower limit of the range is exceeded. See gtk_spin_button_set_wrap().
new_with_rangeThis is a convenience constructor that allows creation of a numeric GtkSpinButton without manually creating an adjustment.
set_adjustmentReplaces the GtkAdjustment associated with spin_button.
set_digitsSet the precision to be displayed by spin_button. Up to 20 digit precision is allowed.
set_incrementsSets the step and page increments for spin_button.
set_numericSets the flag that determines if non-numeric text can be typed into the spin button.
set_rangeSets the minimum and maximum allowable values for spin_button
set_snap_to_ticksSets the policy as to whether values are corrected to the nearest step increment when a spin button is activated after providing an invalid value.
set_update_policySets the update behavior of a spin button.
set_valueSet the value of spin_button.
set_wrapSets the flag that determines if a spin button value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.
signal_change_valueConnect a VMSlot to the spinbutton change-value signal and return it
signal_outputThe output signal can be used to change to formatting of the value that is displayed in the spin buttons entry.
signal_value_changedConnect a VMSlot to the spinbutton value_changed signal and return it
signal_wrappedThe wrapped signal is emitted right after the spinbutton wraps from its maximum to minimum value or vice-versa.
spinIncrement or decrement a spin button's value in a specified direction by a specified amount.
updateManually force an update of the spin button.

Methods

configure

Changes the properties of an existing spin button.

GtkSpinButton.configure( adjustment, climb_rate, digits )
adjustment a GtkAdjustment, or nil.
climb_rate the new climb rate.
digits the number of decimal places to display in the spin button.

The adjustment, climb rate, and number of decimal places are all changed accordingly, after this function call.

get_adjustment

Get the adjustment associated with a GtkSpinButton

GtkSpinButton.get_adjustment()
Returnthe GtkAdjustment of spin_button

get_digits

Fetches the precision of spin_button.

GtkSpinButton.get_digits()
Returnthe current precision

See gtk_spin_button_set_digits().

get_increments

Gets the current step and page the increments used by spin_button.

GtkSpinButton.get_increments()
ReturnAn array [ step increment, page increment ]

See gtk_spin_button_set_increments().

get_numeric

Returns whether non-numeric text can be typed into the spin button.

GtkSpinButton.get_numeric()
ReturnTRUE if only numeric text can be entered

See gtk_spin_button_set_numeric().

get_range

Gets the range allowed for spin_button.

GtkSpinButton.get_range()
ReturnAn array [ min range, max range ]

See gtk_spin_button_set_range().

get_snap_to_ticks

Returns whether the values are corrected to the nearest step.

GtkSpinButton.get_snap_to_ticks()
ReturnTRUE if values are snapped to the nearest step.

See gtk_spin_button_set_snap_to_ticks().

get_update_policy

Gets the update behavior of a spin button. See gtk_spin_button_set_update_policy().

GtkSpinButton.get_update_policy()
Returnthe current update policy (GtkSpinButtonUpdatePolicy)

get_value

Get the value in the spin_button.

GtkSpinButton.get_value()
Returnthe value of spin_button

get_value_as_int

Get the value spin_button represented as an integer.

GtkSpinButton.get_value_as_int()
Returnthe value of spin_button

get_wrap

Returns whether the spin button's value wraps around to the opposite limit when the upper or lower limit of the range is exceeded. See gtk_spin_button_set_wrap().

GtkSpinButton.get_wrap()
ReturnTRUE if the spin button wraps around

new_with_range

This is a convenience constructor that allows creation of a numeric GtkSpinButton without manually creating an adjustment.

GtkSpinButton.new_with_range( min, max, step )
min Minimum allowable value
max Maximum allowable value
step Increment added or subtracted by spinning the widget
ReturnThe new spin button.

The value is initially set to the minimum value and a page increment of 10 * step is the default. The precision of the spin button is equivalent to the precision of step.

Note that the way in which the precision is derived works best if step is a power of ten. If the resulting precision is not suitable for your needs, use gtk_spin_button_set_digits() to correct it.

set_adjustment

Replaces the GtkAdjustment associated with spin_button.

GtkSpinButton.set_adjustment( adjustment )
adjustment a GtkAdjustment to replace the existing adjustment

set_digits

Set the precision to be displayed by spin_button. Up to 20 digit precision is allowed.

GtkSpinButton.set_digits( digits )
digits the number of digits after the decimal point to be displayed for the spin button's value

set_increments

Sets the step and page increments for spin_button.

GtkSpinButton.set_increments( step, page )
step increment applied for a button 1 press.
page increment applied for a button 2 press.

This affects how quickly the value changes when the spin button's arrows are activated.

set_numeric

Sets the flag that determines if non-numeric text can be typed into the spin button.

GtkSpinButton.set_numeric( numeric )
numeric flag indicating if only numeric entry is allowed.

set_range

Sets the minimum and maximum allowable values for spin_button

GtkSpinButton.set_range( min, max )
min minimum allowable value
max maximum allowable value

set_snap_to_ticks

Sets the policy as to whether values are corrected to the nearest step increment when a spin button is activated after providing an invalid value.

GtkSpinButton.set_snap_to_ticks( snap_to_ticks )
snap_to_ticks a flag indicating if invalid values should be corrected.

set_update_policy

Sets the update behavior of a spin button.

GtkSpinButton.set_update_policy( policy )
policy A GtkSpinButtonUpdatePolicy value

This determines whether the spin button is always updated or only when a valid value is set.

set_value

Set the value of spin_button.

GtkSpinButton.set_value( value )
value the new value

set_wrap

Sets the flag that determines if a spin button value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.

GtkSpinButton.set_wrap( wrap )
wrap a flag indicating if wrapping behavior is performed.

signal_change_value

Connect a VMSlot to the spinbutton change-value signal and return it

GtkSpinButton.signal_change_value()

signal_output

The output signal can be used to change to formatting of the value that is displayed in the spin buttons entry.

GtkSpinButton.signal_output()

signal_value_changed

Connect a VMSlot to the spinbutton value_changed signal and return it

GtkSpinButton.signal_value_changed()

signal_wrapped

The wrapped signal is emitted right after the spinbutton wraps from its maximum to minimum value or vice-versa.

GtkSpinButton.signal_wrapped()

spin

Increment or decrement a spin button's value in a specified direction by a specified amount.

GtkSpinButton.spin( direction, increment )
direction a GtkSpinType indicating the direction to spin.
increment step increment to apply in the specified direction.

update

Manually force an update of the spin button.

GtkSpinButton.update()
Made with http://www.falconpl.org