Class: Gtk::SpinButton

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#adjustmentGtk::Adjustment

Returns adjustment.

Returns:

#adjustment=(adjustment) ⇒ Gtk::Adjustment

Parameters:

Returns:

#climb_rateFloat

Returns climb-rate.

Returns:

  • (Float)

    climb-rate

#climb_rate=(climb_rate) ⇒ Float

Parameters:

  • climb_rate (Float)

Returns:

  • (Float)

    climb-rate

  • (Float)

    climb-rate

#configure(adjustment, climb_rate, digits) ⇒ nil

Changes the properties of an existing spin button. The adjustment, climb rate, and number of decimal places are updated accordingly.

Parameters:

  • adjustment (Gtk::Adjustment)

    a Gtk::Adjustment to replace the spin button’s existing adjustment, or nil to leave its current adjustment unchanged

  • climb_rate (Float)

    the new climb rate

  • digits (Integer)

    the number of decimal places to display in the spin button

Returns:

  • (nil)

#digitsInteger

Returns digits.

Returns:

  • (Integer)

    digits

#digits=(digits) ⇒ Integer

Parameters:

  • digits (Integer)

Returns:

  • (Integer)

    digits

  • (Integer)

    digits

#get_increments(step, page) ⇒ nil

Gets the current step and page the increments used by spin_button. See gtk_spin_button_set_increments().

Parameters:

  • step (Float)

    location to store step increment, or nil

  • page (Float)

    location to store page increment, or nil

Returns:

  • (nil)

#get_range(min, max) ⇒ nil

Gets the range allowed for spin_button. See gtk_spin_button_set_range().

Parameters:

  • min (Float)

    location to store minimum allowed value, or nil

  • max (Float)

    location to store maximum allowed value, or nil

Returns:

  • (nil)

#new(adjustment, climb_rate, digits) ⇒ Gtk::Widget

Creates a new Gtk::SpinButton.

Parameters:

  • adjustment (Gtk::Adjustment)

    the Gtk::Adjustment object that this spin button should use, or nil

  • climb_rate (Float)

    specifies by how much the rate of change in the value will accelerate if you continue to hold down an up/down button or arrow key

  • digits (Integer)

    the number of decimal places to display

Returns:

  • (Gtk::Widget)

    The new spin button as a Gtk::Widget

#new_with_range(min, max, step) ⇒ Gtk::Widget

This is a convenience constructor that allows creation of a numeric Gtk::SpinButton without manually creating an adjustment. 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.

Parameters:

  • min (Float)

    Minimum allowable value

  • max (Float)

    Maximum allowable value

  • step (Float)

    Increment added or subtracted by spinning the widget

Returns:

  • (Gtk::Widget)

    The new spin button as a Gtk::Widget

#numericTrueClass

Returns whether non-numeric text can be typed into the spin button. See gtk_spin_button_set_numeric().

Returns:

  • (TrueClass)

    true if only numeric text can be entered

#numeric=(numeric) ⇒ TrueClass

Parameters:

  • numeric (TrueClass)

Returns:

  • (TrueClass)

    numeric

  • (TrueClass)

    numeric

#numeric?TrueClass

Returns numeric.

Returns:

  • (TrueClass)

    numeric

#set_increments(step, page) ⇒ nil

Sets the step and page increments for spin_button. This affects how quickly the value changes when the spin button’s arrows are activated.

Parameters:

  • step (Float)

    increment applied for a button 1 press.

  • page (Float)

    increment applied for a button 2 press.

Returns:

  • (nil)

#set_range(min, max) ⇒ nil

Sets the minimum and maximum allowable values for spin_button.

If the current value is outside this range, it will be adjusted to fit within the range, otherwise it will remain unchanged.

Parameters:

  • min (Float)

    minimum allowable value

  • max (Float)

    maximum allowable value

Returns:

  • (nil)

#snap_to_ticksTrueClass

Returns whether the values are corrected to the nearest step. See gtk_spin_button_set_snap_to_ticks().

Returns:

  • (TrueClass)

    true if values are snapped to the nearest step

#snap_to_ticks=(snap_to_ticks) ⇒ TrueClass

Parameters:

  • snap_to_ticks (TrueClass)

Returns:

  • (TrueClass)

    snap-to-ticks

  • (TrueClass)

    snap-to-ticks

#snap_to_ticks?TrueClass

Returns snap-to-ticks.

Returns:

  • (TrueClass)

    snap-to-ticks

#spin(direction, increment) ⇒ nil

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

Parameters:

  • direction (Gtk::SpinType)

    a Gtk::SpinType indicating the direction to spin

  • increment (Float)

    step increment to apply in the specified direction

Returns:

  • (nil)

#updatenil

Manually force an update of the spin button.

Returns:

  • (nil)

#update_policyGtk::SpinButtonUpdatePolicy

Returns update-policy.

Returns:

#update_policy=(update_policy) ⇒ Gtk::SpinButtonUpdatePolicy

Parameters:

Returns:

#valueFloat

Returns value.

Returns:

  • (Float)

    value

#value=(value) ⇒ Float

Parameters:

  • value (Float)

Returns:

  • (Float)

    value

  • (Float)

    value

#value_as_intInteger

Get the value spin_button represented as an integer.

Returns:

  • (Integer)

    the value of spin_button

#wrapTrueClass

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().

Returns:

  • (TrueClass)

    true if the spin button wraps around

#wrap=(wrap) ⇒ TrueClass

Parameters:

  • wrap (TrueClass)

Returns:

  • (TrueClass)

    wrap

  • (TrueClass)

    wrap

#wrap?TrueClass

Returns wrap.

Returns:

  • (TrueClass)

    wrap