[ruby-gnome2-doc-cvs] [Hiki] update - Gtk::SpinButton

Back to archive index

ruby-****@lists***** ruby-****@lists*****
2003年 4月 28日 (月) 18:35:11 JST


-------------------------
REMOTE_ADDR = 61.204.181.66
REMOTE_HOST = 
-------------------------
= class Gtk::SpinButton
A Gtk::SpinButton 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 Gtk::Entry, Gtk::SpinButton 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 Gtk::SpinButton are through a Gtk::Adjustment. See the Gtk::Adjustment section for more details about an adjustment's properties.

== super class
* ((<Gtk::Entry>))

== class methods
--- Gtk::SpinButton.new
    Creates a new Gtk::SpinButton.
    * Returns: The new spin button.  

--- Gtk::SpinButton.new(adjustment, climb_rate, digits)
    Creates a new Gtk::SpinButton with Gtk::Adjustment.
    * adjustment: the Gtk::Adjustment object that this spin button should use. 
    * climb_rate: specifies how much the spin button changes when an arrow is clicked on.(Float)
    * digits: the number of decimal places to display. (Integer)
    * Returns: The new spin button.  

--- Gtk::SpinButton.new(min, max, step)
    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.
    * min: Minimum allowable value(Float)
    * max: Maximum allowable value(Float) 
    * step: Increment added or subtracted by spinning the widget(Float)
    * Returns: The new spin button. 

== public instance methods
--- configure(adjustment, climb_rate, digits)
    Changes the properties of an existing spin button. The adjustment, climb rate, and number of decimal places are all changed accordingly, after this function call.
    * adjustment: a GtkAdjustment. 
    * climb_rate: the new climb rate. 
    * digits: the number of decimal places to display in the spin button.  
    * Returns: self

--- adjustment
    Get the adjustment associated with a Gtk::SpinButton
    * Returns : the GtkAdjustment of spin_button 
--- adjustment=(adjustment)
    Replaces the Gtk::Adjustment associated with spin_button.
    * adjustment: a Gtk::Adjustment to replace the existing adjustment 
    * Returns: adjustment
--- set_adjustment(adjustment)
    Same as adjustment=.
    * adjustment: a Gtk::Adjustment to replace the existing adjustment 
    * Returns: self

--- climb_rate
    Gets the value which specifies how much the spin button changes when an arrow is clicked on.
    * Returns: the value specifies how much the spin button changes when an arrow is clicked on.(Float)
--- climb_rate=(climb_rate)
    Sets the value which specifies how much the spin button changes when an arrow is clicked on.
    * climb_rate: specifies how much the spin button changes when an arrow is clicked on.(Float)
    * Returns: climb_rate
--- set_climb_rate(climb_rate)
    Same as climb_rate=.
    * climb_rate: specifies how much the spin button changes when an arrow is clicked on.(Float)
    * Returns: self

--- digits
    Fetches the precision of spin_button. See Gtk::SpinButton#digits=.
    * Returns: the current precision 
--- digits=(digits)
    Set the precision to be displayed by spin_button. Up to 20 digit precision is allowed.
    * digits: the number of digits to be displayed for the spin button's value 
    * Returns: digits
--- set_digits(digits)
    Same as digits=.
    * digits: the number of digits to be displayed for the spin button's value 
    * Returns: self

--- increments
    Gets the current step and page the increments used by spin_button. See Gtk::SpinButton#set_increments().
    * Returns: [step, page]
       * step: location to store step increment or nil
       * page: location to store page increment or nil
--- set_increments(step, page)
    Sets the step and page increments for spin_button. This affects how quickly the value changes when the spin button's arrows are activated.
    * step: increment applied for a button 1 press. (Float)
    * page: increment applied for a button 2 press. (Float)
    * Returns: self

--- numeric?
    Returns whether non-numeric text can be typed into the spin button. See Gtk::SpinButton#numeric=.
    * Returns: true if only numeric text can be entered 
--- numeric=(numeric)
    Sets the flag that determines if non-numeric text can be typed into the spin button.
    * numeric : flag indicating if only numeric entry is allowed. 
    * Returns: numeric
--- set_numeric(numeric)
    Same as numeric=.
    * numeric : true if only numeric entry is allowed. 
    * Returns: self

--- range
    Gets the range allowed for spin_button. See Gtk::SpinButton#set_range.
    * Returns: [min, max]
       * min: location to store minimum allowed value, or nil 
       * max: location to store maximum allowed value, or nil 
--- set_range(min, max)
    Sets the minimum and maximum allowable values for spin_button
    * min : minimum allowable value (Float)
    * max : maximum allowable value (Float)
    * Returns: self

--- snap_to_ticks?
    Returns whether the values are corrected to the nearest step. See Gtk::SpinButton#snap_to_ticks=.
    * Returns: true if values are snapped to the nearest step. 
--- snap_to_ticks=(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.
    * snap_to_ticks : true if invalid values should be corrected. 
    * Returns: snap_to_ticks
--- set_snap_to_ticks
    Same as snap_to_ticks=.
    * snap_to_ticks : true if invalid values should be corrected. 
    * Returns: self

--- update
    Manually force an update of the spin button.
    * spin_button: a Gtk::SpinButton  

--- update_policy
    Gets the update behavior of a spin button. See Gtk::SpinButton#update_policy=.
    * Returns : the current update policy(((<GtkSpinButtonUpdatePolicy|#GtkSpinButtonUpdatePolicy>)))
--- update_policy=(policy)
    Sets the update behavior of a spin button. This determines whether the spin button is always updated or only when a valid value is set.
    * policy: a ((<GtkSpinButtonUpdatePolicy|#GtkSpinButtonUpdatePolicy>)) value 
    * Returns: policy
--- set_update_policy(policy)
    Same as update_policy=.
    * policy: a ((<GtkSpinButtonUpdatePolicy|#GtkSpinButtonUpdatePolicy>)) value 
    * Returns: self

--- value
    Get the value in the spin_button.
    * Returns: the value of spin_button 
--- value=(value)
    Set the value of spin_button.
    * value: the new value(Float)
    * Returns: value
--- set_value(value)
    Same as value=.
    * value: the new value(Float)
    * Returns: self

--- value_as_int
    Get the value spin_button represented as an integer.
    * Returns: the value of spin_button 

--- spin(direction, increment)
    Increment or decrement a spin button's value in a specified direction by a specified amount.
    * direction: a ((<GtkSpinType|URL:#GtkSpinType>)) indicating the direction to spin. 
    * increment: step increment to apply in the specified direction. 
    * Returns: self

--- 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::SpinButton#wrap=.
    * Returns: true if the spin button wraps around 
--- wrap=(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.
    * wrap: true if wrapping behavior is performed. 
    * Returns: wrap
--- set_wrap
    Same as wrap=.
    * wrap: true if wrapping behavior is performed. 
    * Returns: self

== constants
=== GtkSpinButtonUpdatePolicy
--- UPDATE_ALWAYS
    When refreshing your Gtk::SpinButton, the value is always displayed.
--- UPDATE_IF_VALID
    When refreshing your Gtk::SpinButton, the value is only displayed if it is valid within the bounds of the spin button's Gtk::Adjustment.

=== GtkSpinType
--- STEP_FORWARD
    This value spin a Gtk::SpinButton by the relevant values of the spin button's Gtk::Adjustment.
--- STEP_BACKWARD
    This value spin a Gtk::SpinButton by the relevant values of the spin button's Gtk::Adjustment.
--- PAGE_FORWARD
    This value spin a Gtk::SpinButton by the relevant values of the spin button's Gtk::Adjustment.
--- PAGE_BACKWARD
    This value spin a Gtk::SpinButton by the relevant values of the spin button's Gtk::Adjustment.
--- HOME
    HOME and END set the spin button's value to the minimum or maxmimum possible values, (set by it's Gtk::Adjustment), respectively.
--- END
    HOME and END set the spin button's value to the minimum or maxmimum possible values, (set by it's Gtk::Adjustment), respectively.
--- USER_DEFINED
    The programmer must specify the exact amount to spin the Gtk::SpinButton.

== signals
--- change-value: self, arg1
     * self: Gtk::SpinButton
     * arg1:

--- input: self, arg1
     * self: Gtk::SpinButton
     * arg1:

--- output: self, arg1
     * self: Gtk::SpinButton
     * arg1:
--- value-changed: self
     * self: Gtk::SpinButton

== See Also
* Gtk::Entry - retrieve text rather than numbers.


((<Masao>))
-------------------------
= class Gtk::SpinButton
A Gtk::SpinButton 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 Gtk::Entry, Gtk::SpinButton 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 Gtk::SpinButton are through a Gtk::Adjustment. See the Gtk::Adjustment section for more details about an adjustment's properties.

== super class
* ((<Gtk::Entry>))

== class methods
--- Gtk::SpinButton.new
    Creates a new Gtk::SpinButton.
    * Returns: The new spin button.  

--- Gtk::SpinButton.new(adjustment, climb_rate, digits)
    Creates a new Gtk::SpinButton with Gtk::Adjustment.
    * adjustment: the Gtk::Adjustment object that this spin button should use. 
    * climb_rate: specifies how much the spin button changes when an arrow is clicked on.(Float)
    * digits: the number of decimal places to display. (Integer)
    * Returns: The new spin button.  

--- Gtk::SpinButton.new(min, max, step)
    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.
    * min: Minimum allowable value(Float)
    * max: Maximum allowable value(Float) 
    * step: Increment added or subtracted by spinning the widget(Float)
    * Returns: The new spin button. 

== public instance methods
--- configure(adjustment, climb_rate, digits)
    Changes the properties of an existing spin button. The adjustment, climb rate, and number of decimal places are all changed accordingly, after this function call.
    * adjustment: a GtkAdjustment. 
    * climb_rate: the new climb rate. 
    * digits: the number of decimal places to display in the spin button.  
    * Returns: self

--- adjustment
    Get the adjustment associated with a Gtk::SpinButton
    * Returns : the GtkAdjustment of spin_button 
--- adjustment=(adjustment)
    Replaces the Gtk::Adjustment associated with spin_button.
    * adjustment: a Gtk::Adjustment to replace the existing adjustment 
    * Returns: adjustment
--- set_adjustment(adjustment)
    Same as adjustment=.
    * adjustment: a Gtk::Adjustment to replace the existing adjustment 
    * Returns: self

--- climb_rate
    Gets the value which specifies how much the spin button changes when an arrow is clicked on.
    * Returns: the value specifies how much the spin button changes when an arrow is clicked on.(Float)
--- climb_rate=(climb_rate)
    Sets the value which specifies how much the spin button changes when an arrow is clicked on.
    * climb_rate: specifies how much the spin button changes when an arrow is clicked on.(Float)
    * Returns: climb_rate
--- set_climb_rate(climb_rate)
    Same as climb_rate=.
    * climb_rate: specifies how much the spin button changes when an arrow is clicked on.(Float)
    * Returns: self

--- digits
    Fetches the precision of spin_button. See Gtk::SpinButton#digits=.
    * Returns: the current precision 
--- digits=(digits)
    Set the precision to be displayed by spin_button. Up to 20 digit precision is allowed.
    * digits: the number of digits to be displayed for the spin button's value 
    * Returns: digits
--- set_digits(digits)
    Same as digits=.
    * digits: the number of digits to be displayed for the spin button's value 
    * Returns: self

--- increments
    Gets the current step and page the increments used by spin_button. See Gtk::SpinButton#set_increments().
    * Returns: [step, page]
       * step: location to store step increment or nil
       * page: location to store page increment or nil
--- set_increments(step, page)
    Sets the step and page increments for spin_button. This affects how quickly the value changes when the spin button's arrows are activated.
    * step: increment applied for a button 1 press. (Float)
    * page: increment applied for a button 2 press. (Float)
    * Returns: self

--- numeric?
    Returns whether non-numeric text can be typed into the spin button. See Gtk::SpinButton#numeric=.
    * Returns: true if only numeric text can be entered 
--- numeric=(numeric)
    Sets the flag that determines if non-numeric text can be typed into the spin button.
    * numeric : flag indicating if only numeric entry is allowed. 
    * Returns: numeric
--- set_numeric(numeric)
    Same as numeric=.
    * numeric : true if only numeric entry is allowed. 
    * Returns: self

--- range
    Gets the range allowed for spin_button. See Gtk::SpinButton#set_range.
    * Returns: [min, max]
       * min: location to store minimum allowed value, or nil 
       * max: location to store maximum allowed value, or nil 
--- set_range(min, max)
    Sets the minimum and maximum allowable values for spin_button
    * min : minimum allowable value (Float)
    * max : maximum allowable value (Float)
    * Returns: self

--- snap_to_ticks?
    Returns whether the values are corrected to the nearest step. See Gtk::SpinButton#snap_to_ticks=.
    * Returns: true if values are snapped to the nearest step. 
--- snap_to_ticks=(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.
    * snap_to_ticks : true if invalid values should be corrected. 
    * Returns: snap_to_ticks
--- set_snap_to_ticks
    Same as snap_to_ticks=.
    * snap_to_ticks : true if invalid values should be corrected. 
    * Returns: self

--- update
    Manually force an update of the spin button.
    * spin_button: a Gtk::SpinButton  

--- update_policy
    Gets the update behavior of a spin button. See Gtk::SpinButton#update_policy=.
    * Returns : the current update policy(((<GtkSpinButtonUpdatePolicy|URL:#GtkSpinButtonUpdatePolicy>)))
--- update_policy=(policy)
    Sets the update behavior of a spin button. This determines whether the spin button is always updated or only when a valid value is set.
    * policy: a ((<GtkSpinButtonUpdatePolicy|URL:#GtkSpinButtonUpdatePolicy>)) value 
    * Returns: policy
--- set_update_policy(policy)
    Same as update_policy=.
    * policy: a ((<GtkSpinButtonUpdatePolicy|URL:#GtkSpinButtonUpdatePolicy>)) value 
    * Returns: self

--- value
    Get the value in the spin_button.
    * Returns: the value of spin_button 
--- value=(value)
    Set the value of spin_button.
    * value: the new value(Float)
    * Returns: value
--- set_value(value)
    Same as value=.
    * value: the new value(Float)
    * Returns: self

--- value_as_int
    Get the value spin_button represented as an integer.
    * Returns: the value of spin_button 

--- spin(direction, increment)
    Increment or decrement a spin button's value in a specified direction by a specified amount.
    * direction: a ((<GtkSpinType|URL:#GtkSpinType>)) indicating the direction to spin. 
    * increment: step increment to apply in the specified direction. 
    * Returns: self

--- 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::SpinButton#wrap=.
    * Returns: true if the spin button wraps around 
--- wrap=(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.
    * wrap: true if wrapping behavior is performed. 
    * Returns: wrap
--- set_wrap
    Same as wrap=.
    * wrap: true if wrapping behavior is performed. 
    * Returns: self

== constants
=== GtkSpinButtonUpdatePolicy
--- UPDATE_ALWAYS
    When refreshing your Gtk::SpinButton, the value is always displayed.
--- UPDATE_IF_VALID
    When refreshing your Gtk::SpinButton, the value is only displayed if it is valid within the bounds of the spin button's Gtk::Adjustment.

=== GtkSpinType
--- STEP_FORWARD
    This value spin a Gtk::SpinButton by the relevant values of the spin button's Gtk::Adjustment.
--- STEP_BACKWARD
    This value spin a Gtk::SpinButton by the relevant values of the spin button's Gtk::Adjustment.
--- PAGE_FORWARD
    This value spin a Gtk::SpinButton by the relevant values of the spin button's Gtk::Adjustment.
--- PAGE_BACKWARD
    This value spin a Gtk::SpinButton by the relevant values of the spin button's Gtk::Adjustment.
--- HOME
    HOME and END set the spin button's value to the minimum or maxmimum possible values, (set by it's Gtk::Adjustment), respectively.
--- END
    HOME and END set the spin button's value to the minimum or maxmimum possible values, (set by it's Gtk::Adjustment), respectively.
--- USER_DEFINED
    The programmer must specify the exact amount to spin the Gtk::SpinButton.

== signals
--- change-value: self, arg1
     * self: Gtk::SpinButton
     * arg1:

--- input: self, arg1
     * self: Gtk::SpinButton
     * arg1:

--- output: self, arg1
     * self: Gtk::SpinButton
     * arg1:
--- value-changed: self
     * self: Gtk::SpinButton

== See Also
* Gtk::Entry - retrieve text rather than numbers.


((<Masao>))



ruby-gnome2-cvs メーリングリストの案内
Back to archive index