Gtk2HsContentsIndex
Graphics.UI.Gtk.Entry.SpinButton
Description
A spin button provides the possiblity to enter a numeric value without using the keyboard.
Synopsis
data SpinButton
class EntryClass o => SpinButtonClass o
castToSpinButton :: GObjectClass obj => obj -> SpinButton
spinButtonNew :: Adjustment -> Double -> Int -> IO SpinButton
spinButtonNewWithRange :: Double -> Double -> Double -> IO SpinButton
spinButtonConfigure :: SpinButtonClass sb => sb -> Adjustment -> Double -> Int -> IO ()
spinButtonSetAdjustment :: SpinButtonClass sb => sb -> Adjustment -> IO ()
spinButtonGetAdjustment :: SpinButtonClass sb => sb -> IO Adjustment
spinButtonSetDigits :: SpinButtonClass sb => sb -> Int -> IO ()
spinButtonGetDigits :: SpinButtonClass sb => sb -> IO Int
spinButtonSetIncrements :: SpinButtonClass sb => sb -> Double -> Double -> IO ()
spinButtonGetIncrements :: SpinButtonClass sb => sb -> IO (Double, Double)
spinButtonSetRange :: SpinButtonClass sb => sb -> Double -> Double -> IO ()
spinButtonGetRange :: SpinButtonClass sb => sb -> IO (Double, Double)
spinButtonGetValue :: SpinButtonClass sb => sb -> IO Double
spinButtonGetValueAsInt :: SpinButtonClass sb => sb -> IO Int
spinButtonSetValue :: SpinButtonClass sb => sb -> Double -> IO ()
data SpinButtonUpdatePolicy
= UpdateAlways
| UpdateIfValid
spinButtonSetUpdatePolicy :: SpinButtonClass sb => sb -> SpinButtonUpdatePolicy -> IO ()
spinButtonGetUpdatePolicy :: SpinButtonClass sb => sb -> IO SpinButtonUpdatePolicy
spinButtonSetNumeric :: SpinButtonClass sb => sb -> Bool -> IO ()
spinButtonGetNumeric :: SpinButtonClass sb => sb -> IO Bool
data SpinType
= SpinStepForward
| SpinStepBackward
| SpinPageForward
| SpinPageBackward
| SpinHome
| SpinEnd
| SpinUserDefined
spinButtonSpin :: SpinButtonClass sb => sb -> SpinType -> Double -> IO ()
spinButtonSetWrap :: SpinButtonClass sb => sb -> Bool -> IO ()
spinButtonGetWrap :: SpinButtonClass sb => sb -> IO Bool
spinButtonSetSnapToTicks :: SpinButtonClass sb => sb -> Bool -> IO ()
spinButtonGetSnapToTicks :: SpinButtonClass sb => sb -> IO Bool
spinButtonUpdate :: SpinButtonClass sb => sb -> IO ()
onInput :: SpinButtonClass sb => sb -> IO (Maybe Double) -> IO (ConnectId sb)
afterInput :: SpinButtonClass sb => sb -> IO (Maybe Double) -> IO (ConnectId sb)
onOutput :: SpinButtonClass sb => sb -> IO Bool -> IO (ConnectId sb)
afterOutput :: SpinButtonClass sb => sb -> IO Bool -> IO (ConnectId sb)
onValueSpinned :: SpinButtonClass sb => sb -> IO () -> IO (ConnectId sb)
afterValueSpinned :: SpinButtonClass sb => sb -> IO () -> IO (ConnectId sb)
Documentation
data SpinButton
Instances
EditableClass SpinButton
SpinButtonClass SpinButton
EntryClass SpinButton
WidgetClass SpinButton
ObjectClass SpinButton
GObjectClass SpinButton
class EntryClass o => SpinButtonClass o
Instances
SpinButtonClass SpinButton
castToSpinButton :: GObjectClass obj => obj -> SpinButton
spinButtonNew :: Adjustment -> Double -> Int -> IO SpinButton

Create a new SpinButton.

  • climbRate is the amount by which the value is changed each time the up/down buttons are pressed.
  • digits is the number of shown digits. Set to 0 to work with integer values.
spinButtonNewWithRange :: Double -> Double -> Double -> IO SpinButton

Create a new SpinButton with a restricted range.

  • This is a convenience function because the user does not have to create an Adjustment first. Page increments are set to 10 * step.
spinButtonConfigure :: SpinButtonClass sb => sb -> Adjustment -> Double -> Int -> IO ()
Change the settings of a SpinButton.
spinButtonSetAdjustment :: SpinButtonClass sb => sb -> Adjustment -> IO ()
Attach a new Adjustment object to the SpinButton.
spinButtonGetAdjustment :: SpinButtonClass sb => sb -> IO Adjustment
Retrieve the Adjustment object that is currently controlling the SpinButton.
spinButtonSetDigits :: SpinButtonClass sb => sb -> Int -> IO ()
Sets the number of shown digits.
spinButtonGetDigits :: SpinButtonClass sb => sb -> IO Int
Gets the number of digits shown.
spinButtonSetIncrements :: SpinButtonClass sb => sb -> Double -> Double -> IO ()
Sets the increment for up/down buttons.
spinButtonGetIncrements :: SpinButtonClass sb => sb -> IO (Double, Double)
Sets the increment for up/down buttons.
spinButtonSetRange :: SpinButtonClass sb => sb -> Double -> Double -> IO ()
Set the maximal allowable range for the spinbutton.
spinButtonGetRange :: SpinButtonClass sb => sb -> IO (Double, Double)
Get the maximal allowable range for the spinbutton.
spinButtonGetValue :: SpinButtonClass sb => sb -> IO Double
Retrieve the current value as a floating point value.
spinButtonGetValueAsInt :: SpinButtonClass sb => sb -> IO Int
Retrieve the current value as integral value.
spinButtonSetValue :: SpinButtonClass sb => sb -> Double -> IO ()
Set the value of the SpinButton.
data SpinButtonUpdatePolicy
Whether to clamp or ignore illegal values.
Constructors
UpdateAlways
UpdateIfValid
Instances
Enum SpinButtonUpdatePolicy
spinButtonSetUpdatePolicy :: SpinButtonClass sb => sb -> SpinButtonUpdatePolicy -> IO ()
Whether the an out-of-range value set by spinButtonSetValue is clamped to the limits or simply ignored.
spinButtonGetUpdatePolicy :: SpinButtonClass sb => sb -> IO SpinButtonUpdatePolicy
Gets the update behavior of a spin button. See spinButtonSetUpdatePolicy.
spinButtonSetNumeric :: SpinButtonClass sb => sb -> Bool -> IO ()
Sets the flag that determines if non-numeric text can be typed into the spin button.
spinButtonGetNumeric :: SpinButtonClass sb => sb -> IO Bool
Returns whether non-numeric text can be typed into the spin button.
data SpinType
Spin a SpinButton with the following method.
Constructors
SpinStepForward
SpinStepBackward
SpinPageForward
SpinPageBackward
SpinHome
SpinEnd
SpinUserDefined
Instances
Enum SpinType
spinButtonSpin :: SpinButtonClass sb => sb -> SpinType -> Double -> IO ()
Increment or decrement the current value of the SpinButton.
spinButtonSetWrap :: SpinButtonClass sb => sb -> Bool -> IO ()
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.
spinButtonGetWrap :: SpinButtonClass sb => sb -> IO Bool
Returns whether the spin button's value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.
spinButtonSetSnapToTicks :: SpinButtonClass sb => sb -> Bool -> IO ()
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.
spinButtonGetSnapToTicks :: SpinButtonClass sb => sb -> IO Bool
Returns whether the values are corrected to the nearest step.
spinButtonUpdate :: SpinButtonClass sb => sb -> IO ()
Force an update of the SpinButton.
onInput :: SpinButtonClass sb => sb -> IO (Maybe Double) -> IO (ConnectId sb)

Install a custom input handler.

  • This signal is called upon each time the value of the SpinButton is set by spinButtonSetValue. The function can return Nothing if the value is no good.
afterInput :: SpinButtonClass sb => sb -> IO (Maybe Double) -> IO (ConnectId sb)
onOutput :: SpinButtonClass sb => sb -> IO Bool -> IO (ConnectId sb)

Install a custom output handler.

  • This handler makes it possible to query the current value and to render something completely different to the screen using entrySetText. The return value must be False in order to let the default output routine run after this signal returns.
afterOutput :: SpinButtonClass sb => sb -> IO Bool -> IO (ConnectId sb)
onValueSpinned :: SpinButtonClass sb => sb -> IO () -> IO (ConnectId sb)
The value of the spin button has changed.
afterValueSpinned :: SpinButtonClass sb => sb -> IO () -> IO (ConnectId sb)
Produced by Haddock version 0.6