Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
A 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
Entry
, 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 an adjustment.
See the Adjustment
section for more details about an adjustment's
properties. Note that GtkSpinButton will by default make its entry
large enough to accomodate the lower and upper bounds of the adjustment,
which can lead to surprising results. Best practice is to set both
the Entry
:width-chars
and Entry
:max-width-chars
poperties
to the desired number of characters to display in the entry.
CSS nodes
plain code
spinbutton.horizontal ├── entry │ ╰── ... ├── button.down ╰── button.up
plain code
spinbutton.vertical ├── button.up ├── entry │ ╰── ... ╰── button.down
GtkSpinButtons main CSS node has the name spinbutton. It creates subnodes for the entry and the two buttons, with these names. The button nodes have the style classes .up and .down. The GtkEntry subnodes (if present) are put below the entry node. The orientation of the spin button is reflected in the .vertical or .horizontal style class on the main node.
Using a GtkSpinButton to get an integer
C code
// Provides a function to retrieve an integer value from a GtkSpinButton // and creates a spin button to model percentage values. gint grab_int_value (GtkSpinButton *button, gpointer user_data) { return gtk_spin_button_get_value_as_int (button); } void create_integer_spin_button (void) { GtkWidget *window, *button; GtkAdjustment *adjustment; adjustment = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 0.0); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 5); // creates the spinbutton, with no decimal places button = gtk_spin_button_new (adjustment, 1.0, 0); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show_all (window); }
Using a GtkSpinButton to get a floating point value
C code
// Provides a function to retrieve a floating point value from a // GtkSpinButton, and creates a high precision spin button. gfloat grab_float_value (GtkSpinButton *button, gpointer user_data) { return gtk_spin_button_get_value (button); } void create_floating_spin_button (void) { GtkWidget *window, *button; GtkAdjustment *adjustment; adjustment = gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.0); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 5); // creates the spinbutton, with three decimal places button = gtk_spin_button_new (adjustment, 0.001, 3); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show_all (window); }
- newtype SpinButton = SpinButton (ManagedPtr SpinButton)
- class GObject o => IsSpinButton o
- toSpinButton :: IsSpinButton o => o -> IO SpinButton
- noSpinButton :: Maybe SpinButton
- data SpinButtonConfigureMethodInfo
- spinButtonConfigure :: (HasCallStack, MonadIO m, IsSpinButton a, IsAdjustment b) => a -> Maybe b -> Double -> Word32 -> m ()
- data SpinButtonGetAdjustmentMethodInfo
- spinButtonGetAdjustment :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m Adjustment
- data SpinButtonGetDigitsMethodInfo
- spinButtonGetDigits :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m Word32
- data SpinButtonGetIncrementsMethodInfo
- spinButtonGetIncrements :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m (Double, Double)
- data SpinButtonGetNumericMethodInfo
- spinButtonGetNumeric :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m Bool
- data SpinButtonGetRangeMethodInfo
- spinButtonGetRange :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m (Double, Double)
- data SpinButtonGetSnapToTicksMethodInfo
- spinButtonGetSnapToTicks :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m Bool
- data SpinButtonGetUpdatePolicyMethodInfo
- spinButtonGetUpdatePolicy :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m SpinButtonUpdatePolicy
- data SpinButtonGetValueMethodInfo
- spinButtonGetValue :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m Double
- data SpinButtonGetValueAsIntMethodInfo
- spinButtonGetValueAsInt :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m Int32
- data SpinButtonGetWrapMethodInfo
- spinButtonGetWrap :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m Bool
- spinButtonNew :: (HasCallStack, MonadIO m, IsAdjustment a) => Maybe a -> Double -> Word32 -> m SpinButton
- spinButtonNewWithRange :: (HasCallStack, MonadIO m) => Double -> Double -> Double -> m SpinButton
- data SpinButtonSetAdjustmentMethodInfo
- spinButtonSetAdjustment :: (HasCallStack, MonadIO m, IsSpinButton a, IsAdjustment b) => a -> b -> m ()
- data SpinButtonSetDigitsMethodInfo
- spinButtonSetDigits :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> Word32 -> m ()
- data SpinButtonSetIncrementsMethodInfo
- spinButtonSetIncrements :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> Double -> Double -> m ()
- data SpinButtonSetNumericMethodInfo
- spinButtonSetNumeric :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> Bool -> m ()
- data SpinButtonSetRangeMethodInfo
- spinButtonSetRange :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> Double -> Double -> m ()
- data SpinButtonSetSnapToTicksMethodInfo
- spinButtonSetSnapToTicks :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> Bool -> m ()
- data SpinButtonSetUpdatePolicyMethodInfo
- spinButtonSetUpdatePolicy :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> SpinButtonUpdatePolicy -> m ()
- data SpinButtonSetValueMethodInfo
- spinButtonSetValue :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> Double -> m ()
- data SpinButtonSetWrapMethodInfo
- spinButtonSetWrap :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> Bool -> m ()
- data SpinButtonSpinMethodInfo
- spinButtonSpin :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> SpinType -> Double -> m ()
- data SpinButtonUpdateMethodInfo
- spinButtonUpdate :: (HasCallStack, MonadIO m, IsSpinButton a) => a -> m ()
- data SpinButtonAdjustmentPropertyInfo
- constructSpinButtonAdjustment :: (IsSpinButton o, IsAdjustment a) => a -> IO (GValueConstruct o)
- getSpinButtonAdjustment :: (MonadIO m, IsSpinButton o) => o -> m Adjustment
- setSpinButtonAdjustment :: (MonadIO m, IsSpinButton o, IsAdjustment a) => o -> a -> m ()
- spinButtonAdjustment :: AttrLabelProxy "adjustment"
- data SpinButtonClimbRatePropertyInfo
- constructSpinButtonClimbRate :: IsSpinButton o => Double -> IO (GValueConstruct o)
- getSpinButtonClimbRate :: (MonadIO m, IsSpinButton o) => o -> m Double
- setSpinButtonClimbRate :: (MonadIO m, IsSpinButton o) => o -> Double -> m ()
- spinButtonClimbRate :: AttrLabelProxy "climbRate"
- data SpinButtonDigitsPropertyInfo
- constructSpinButtonDigits :: IsSpinButton o => Word32 -> IO (GValueConstruct o)
- getSpinButtonDigits :: (MonadIO m, IsSpinButton o) => o -> m Word32
- setSpinButtonDigits :: (MonadIO m, IsSpinButton o) => o -> Word32 -> m ()
- spinButtonDigits :: AttrLabelProxy "digits"
- data SpinButtonNumericPropertyInfo
- constructSpinButtonNumeric :: IsSpinButton o => Bool -> IO (GValueConstruct o)
- getSpinButtonNumeric :: (MonadIO m, IsSpinButton o) => o -> m Bool
- setSpinButtonNumeric :: (MonadIO m, IsSpinButton o) => o -> Bool -> m ()
- spinButtonNumeric :: AttrLabelProxy "numeric"
- data SpinButtonSnapToTicksPropertyInfo
- constructSpinButtonSnapToTicks :: IsSpinButton o => Bool -> IO (GValueConstruct o)
- getSpinButtonSnapToTicks :: (MonadIO m, IsSpinButton o) => o -> m Bool
- setSpinButtonSnapToTicks :: (MonadIO m, IsSpinButton o) => o -> Bool -> m ()
- spinButtonSnapToTicks :: AttrLabelProxy "snapToTicks"
- data SpinButtonUpdatePolicyPropertyInfo
- constructSpinButtonUpdatePolicy :: IsSpinButton o => SpinButtonUpdatePolicy -> IO (GValueConstruct o)
- getSpinButtonUpdatePolicy :: (MonadIO m, IsSpinButton o) => o -> m SpinButtonUpdatePolicy
- setSpinButtonUpdatePolicy :: (MonadIO m, IsSpinButton o) => o -> SpinButtonUpdatePolicy -> m ()
- spinButtonUpdatePolicy :: AttrLabelProxy "updatePolicy"
- data SpinButtonValuePropertyInfo
- constructSpinButtonValue :: IsSpinButton o => Double -> IO (GValueConstruct o)
- getSpinButtonValue :: (MonadIO m, IsSpinButton o) => o -> m Double
- setSpinButtonValue :: (MonadIO m, IsSpinButton o) => o -> Double -> m ()
- spinButtonValue :: AttrLabelProxy "value"
- data SpinButtonWrapPropertyInfo
- constructSpinButtonWrap :: IsSpinButton o => Bool -> IO (GValueConstruct o)
- getSpinButtonWrap :: (MonadIO m, IsSpinButton o) => o -> m Bool
- setSpinButtonWrap :: (MonadIO m, IsSpinButton o) => o -> Bool -> m ()
- spinButtonWrap :: AttrLabelProxy "wrap"
- type C_SpinButtonChangeValueCallback = Ptr () -> CUInt -> Ptr () -> IO ()
- type SpinButtonChangeValueCallback = ScrollType -> IO ()
- data SpinButtonChangeValueSignalInfo
- afterSpinButtonChangeValue :: (GObject a, MonadIO m) => a -> SpinButtonChangeValueCallback -> m SignalHandlerId
- genClosure_SpinButtonChangeValue :: SpinButtonChangeValueCallback -> IO Closure
- mk_SpinButtonChangeValueCallback :: C_SpinButtonChangeValueCallback -> IO (FunPtr C_SpinButtonChangeValueCallback)
- noSpinButtonChangeValueCallback :: Maybe SpinButtonChangeValueCallback
- onSpinButtonChangeValue :: (GObject a, MonadIO m) => a -> SpinButtonChangeValueCallback -> m SignalHandlerId
- wrap_SpinButtonChangeValueCallback :: SpinButtonChangeValueCallback -> Ptr () -> CUInt -> Ptr () -> IO ()
- type C_SpinButtonInputCallback = Ptr () -> Ptr CDouble -> Ptr () -> IO Int32
- type SpinButtonInputCallback = IO (Int32, Double)
- data SpinButtonInputSignalInfo
- afterSpinButtonInput :: (GObject a, MonadIO m) => a -> SpinButtonInputCallback -> m SignalHandlerId
- genClosure_SpinButtonInput :: SpinButtonInputCallback -> IO Closure
- mk_SpinButtonInputCallback :: C_SpinButtonInputCallback -> IO (FunPtr C_SpinButtonInputCallback)
- noSpinButtonInputCallback :: Maybe SpinButtonInputCallback
- onSpinButtonInput :: (GObject a, MonadIO m) => a -> SpinButtonInputCallback -> m SignalHandlerId
- wrap_SpinButtonInputCallback :: SpinButtonInputCallback -> Ptr () -> Ptr CDouble -> Ptr () -> IO Int32
- type C_SpinButtonOutputCallback = Ptr () -> Ptr () -> IO CInt
- type SpinButtonOutputCallback = IO Bool
- data SpinButtonOutputSignalInfo
- afterSpinButtonOutput :: (GObject a, MonadIO m) => a -> SpinButtonOutputCallback -> m SignalHandlerId
- genClosure_SpinButtonOutput :: SpinButtonOutputCallback -> IO Closure
- mk_SpinButtonOutputCallback :: C_SpinButtonOutputCallback -> IO (FunPtr C_SpinButtonOutputCallback)
- noSpinButtonOutputCallback :: Maybe SpinButtonOutputCallback
- onSpinButtonOutput :: (GObject a, MonadIO m) => a -> SpinButtonOutputCallback -> m SignalHandlerId
- wrap_SpinButtonOutputCallback :: SpinButtonOutputCallback -> Ptr () -> Ptr () -> IO CInt
- type C_SpinButtonValueChangedCallback = Ptr () -> Ptr () -> IO ()
- type SpinButtonValueChangedCallback = IO ()
- data SpinButtonValueChangedSignalInfo
- afterSpinButtonValueChanged :: (GObject a, MonadIO m) => a -> SpinButtonValueChangedCallback -> m SignalHandlerId
- genClosure_SpinButtonValueChanged :: SpinButtonValueChangedCallback -> IO Closure
- mk_SpinButtonValueChangedCallback :: C_SpinButtonValueChangedCallback -> IO (FunPtr C_SpinButtonValueChangedCallback)
- noSpinButtonValueChangedCallback :: Maybe SpinButtonValueChangedCallback
- onSpinButtonValueChanged :: (GObject a, MonadIO m) => a -> SpinButtonValueChangedCallback -> m SignalHandlerId
- wrap_SpinButtonValueChangedCallback :: SpinButtonValueChangedCallback -> Ptr () -> Ptr () -> IO ()
- type C_SpinButtonWrappedCallback = Ptr () -> Ptr () -> IO ()
- type SpinButtonWrappedCallback = IO ()
- data SpinButtonWrappedSignalInfo
- afterSpinButtonWrapped :: (GObject a, MonadIO m) => a -> SpinButtonWrappedCallback -> m SignalHandlerId
- genClosure_SpinButtonWrapped :: SpinButtonWrappedCallback -> IO Closure
- mk_SpinButtonWrappedCallback :: C_SpinButtonWrappedCallback -> IO (FunPtr C_SpinButtonWrappedCallback)
- noSpinButtonWrappedCallback :: Maybe SpinButtonWrappedCallback
- onSpinButtonWrapped :: (GObject a, MonadIO m) => a -> SpinButtonWrappedCallback -> m SignalHandlerId
- wrap_SpinButtonWrappedCallback :: SpinButtonWrappedCallback -> Ptr () -> Ptr () -> IO ()
Exported types
newtype SpinButton Source #
GObject SpinButton Source # | |
IsImplementorIface SpinButton Source # | |
IsObject SpinButton Source # | |
IsWidget SpinButton Source # | |
IsSpinButton SpinButton Source # | |
IsEntry SpinButton Source # | |
IsOrientable SpinButton Source # | |
IsEditable SpinButton Source # | |
IsCellEditable SpinButton Source # | |
IsBuildable SpinButton Source # | |
((~) * info (ResolveSpinButtonMethod t SpinButton), MethodInfo * info SpinButton p) => IsLabel t (SpinButton -> p) Source # | |
((~) * info (ResolveSpinButtonMethod t SpinButton), MethodInfo * info SpinButton p) => IsLabelProxy t (SpinButton -> p) Source # | |
HasAttributeList * SpinButton Source # | |
type AttributeList SpinButton Source # | |
type SignalList SpinButton Source # | |
class GObject o => IsSpinButton o Source #
toSpinButton :: IsSpinButton o => o -> IO SpinButton Source #
Methods
configure
data SpinButtonConfigureMethodInfo Source #
((~) * signature (Maybe b -> Double -> Word32 -> m ()), MonadIO m, IsSpinButton a, IsAdjustment b) => MethodInfo * SpinButtonConfigureMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a, IsAdjustment b) | |
=> a |
|
-> Maybe b |
|
-> Double |
|
-> Word32 |
|
-> m () |
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.
getAdjustment
data SpinButtonGetAdjustmentMethodInfo Source #
((~) * signature (m Adjustment), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetAdjustmentMethodInfo a signature Source # | |
spinButtonGetAdjustment Source #
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m Adjustment | Returns: the |
Get the adjustment associated with a SpinButton
getDigits
data SpinButtonGetDigitsMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetDigitsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m Word32 | Returns: the current precision |
Fetches the precision of spinButton
. See spinButtonSetDigits
.
getIncrements
data SpinButtonGetIncrementsMethodInfo Source #
((~) * signature (m (Double, Double)), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetIncrementsMethodInfo a signature Source # | |
spinButtonGetIncrements Source #
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m (Double, Double) |
Gets the current step and page the increments used by spinButton
. See
spinButtonSetIncrements
.
getNumeric
data SpinButtonGetNumericMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetNumericMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether non-numeric text can be typed into the spin button.
See spinButtonSetNumeric
.
getRange
data SpinButtonGetRangeMethodInfo Source #
((~) * signature (m (Double, Double)), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetRangeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m (Double, Double) |
Gets the range allowed for spinButton
.
See spinButtonSetRange
.
getSnapToTicks
data SpinButtonGetSnapToTicksMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetSnapToTicksMethodInfo a signature Source # | |
spinButtonGetSnapToTicks Source #
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the values are corrected to the nearest step.
See spinButtonSetSnapToTicks
.
getUpdatePolicy
data SpinButtonGetUpdatePolicyMethodInfo Source #
((~) * signature (m SpinButtonUpdatePolicy), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetUpdatePolicyMethodInfo a signature Source # | |
spinButtonGetUpdatePolicy Source #
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m SpinButtonUpdatePolicy | Returns: the current update policy |
Gets the update behavior of a spin button.
See spinButtonSetUpdatePolicy
.
getValue
data SpinButtonGetValueMethodInfo Source #
((~) * signature (m Double), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetValueMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m Double | Returns: the value of |
Get the value in the spinButton
.
getValueAsInt
data SpinButtonGetValueAsIntMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetValueAsIntMethodInfo a signature Source # | |
spinButtonGetValueAsInt Source #
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m Int32 | Returns: the value of |
Get the value spinButton
represented as an integer.
getWrap
data SpinButtonGetWrapMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonGetWrapMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m Bool | Returns: |
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 spinButtonSetWrap
.
new
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> Maybe a |
|
-> Double |
|
-> Word32 |
|
-> m SpinButton | Returns: The new spin button as a |
Creates a new SpinButton
.
newWithRange
spinButtonNewWithRange Source #
:: (HasCallStack, MonadIO m) | |
=> Double |
|
-> Double |
|
-> Double |
|
-> m SpinButton | Returns: The new spin button as a |
This is a convenience constructor that allows creation of a numeric
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 spinButtonSetDigits
to correct it.
setAdjustment
data SpinButtonSetAdjustmentMethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsSpinButton a, IsAdjustment b) => MethodInfo * SpinButtonSetAdjustmentMethodInfo a signature Source # | |
spinButtonSetAdjustment Source #
:: (HasCallStack, MonadIO m, IsSpinButton a, IsAdjustment b) | |
=> a |
|
-> b |
|
-> m () |
Replaces the Adjustment
associated with spinButton
.
setDigits
data SpinButtonSetDigitsMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSetDigitsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> Word32 |
|
-> m () |
Set the precision to be displayed by spinButton
. Up to 20 digit precision
is allowed.
setIncrements
data SpinButtonSetIncrementsMethodInfo Source #
((~) * signature (Double -> Double -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSetIncrementsMethodInfo a signature Source # | |
spinButtonSetIncrements Source #
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> Double |
|
-> Double |
|
-> m () |
Sets the step and page increments for spin_button. This affects how quickly the value changes when the spin button’s arrows are activated.
setNumeric
data SpinButtonSetNumericMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSetNumericMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets the flag that determines if non-numeric text can be typed into the spin button.
setRange
data SpinButtonSetRangeMethodInfo Source #
((~) * signature (Double -> Double -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSetRangeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> Double |
|
-> Double |
|
-> m () |
Sets the minimum and maximum allowable values for spinButton
.
If the current value is outside this range, it will be adjusted to fit within the range, otherwise it will remain unchanged.
setSnapToTicks
data SpinButtonSetSnapToTicksMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSetSnapToTicksMethodInfo a signature Source # | |
spinButtonSetSnapToTicks Source #
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> Bool |
|
-> m () |
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.
setUpdatePolicy
data SpinButtonSetUpdatePolicyMethodInfo Source #
((~) * signature (SpinButtonUpdatePolicy -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSetUpdatePolicyMethodInfo a signature Source # | |
spinButtonSetUpdatePolicy Source #
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> SpinButtonUpdatePolicy |
|
-> m () |
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.
setValue
data SpinButtonSetValueMethodInfo Source #
((~) * signature (Double -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSetValueMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the value of spinButton
.
setWrap
data SpinButtonSetWrapMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSetWrapMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> Bool |
|
-> m () |
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.
spin
data SpinButtonSpinMethodInfo Source #
((~) * signature (SpinType -> Double -> m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonSpinMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> SpinType |
|
-> Double |
|
-> m () |
Increment or decrement a spin button’s value in a specified direction by a specified amount.
update
data SpinButtonUpdateMethodInfo Source #
((~) * signature (m ()), MonadIO m, IsSpinButton a) => MethodInfo * SpinButtonUpdateMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsSpinButton a) | |
=> a |
|
-> m () |
Manually force an update of the spin button.
Properties
adjustment
data SpinButtonAdjustmentPropertyInfo Source #
constructSpinButtonAdjustment :: (IsSpinButton o, IsAdjustment a) => a -> IO (GValueConstruct o) Source #
getSpinButtonAdjustment :: (MonadIO m, IsSpinButton o) => o -> m Adjustment Source #
setSpinButtonAdjustment :: (MonadIO m, IsSpinButton o, IsAdjustment a) => o -> a -> m () Source #
spinButtonAdjustment :: AttrLabelProxy "adjustment" Source #
climbRate
data SpinButtonClimbRatePropertyInfo Source #
constructSpinButtonClimbRate :: IsSpinButton o => Double -> IO (GValueConstruct o) Source #
getSpinButtonClimbRate :: (MonadIO m, IsSpinButton o) => o -> m Double Source #
setSpinButtonClimbRate :: (MonadIO m, IsSpinButton o) => o -> Double -> m () Source #
spinButtonClimbRate :: AttrLabelProxy "climbRate" Source #
digits
data SpinButtonDigitsPropertyInfo Source #
constructSpinButtonDigits :: IsSpinButton o => Word32 -> IO (GValueConstruct o) Source #
getSpinButtonDigits :: (MonadIO m, IsSpinButton o) => o -> m Word32 Source #
setSpinButtonDigits :: (MonadIO m, IsSpinButton o) => o -> Word32 -> m () Source #
spinButtonDigits :: AttrLabelProxy "digits" Source #
numeric
data SpinButtonNumericPropertyInfo Source #
constructSpinButtonNumeric :: IsSpinButton o => Bool -> IO (GValueConstruct o) Source #
getSpinButtonNumeric :: (MonadIO m, IsSpinButton o) => o -> m Bool Source #
setSpinButtonNumeric :: (MonadIO m, IsSpinButton o) => o -> Bool -> m () Source #
spinButtonNumeric :: AttrLabelProxy "numeric" Source #
snapToTicks
data SpinButtonSnapToTicksPropertyInfo Source #
constructSpinButtonSnapToTicks :: IsSpinButton o => Bool -> IO (GValueConstruct o) Source #
getSpinButtonSnapToTicks :: (MonadIO m, IsSpinButton o) => o -> m Bool Source #
setSpinButtonSnapToTicks :: (MonadIO m, IsSpinButton o) => o -> Bool -> m () Source #
spinButtonSnapToTicks :: AttrLabelProxy "snapToTicks" Source #
updatePolicy
data SpinButtonUpdatePolicyPropertyInfo Source #
constructSpinButtonUpdatePolicy :: IsSpinButton o => SpinButtonUpdatePolicy -> IO (GValueConstruct o) Source #
getSpinButtonUpdatePolicy :: (MonadIO m, IsSpinButton o) => o -> m SpinButtonUpdatePolicy Source #
setSpinButtonUpdatePolicy :: (MonadIO m, IsSpinButton o) => o -> SpinButtonUpdatePolicy -> m () Source #
spinButtonUpdatePolicy :: AttrLabelProxy "updatePolicy" Source #
value
data SpinButtonValuePropertyInfo Source #
constructSpinButtonValue :: IsSpinButton o => Double -> IO (GValueConstruct o) Source #
getSpinButtonValue :: (MonadIO m, IsSpinButton o) => o -> m Double Source #
setSpinButtonValue :: (MonadIO m, IsSpinButton o) => o -> Double -> m () Source #
spinButtonValue :: AttrLabelProxy "value" Source #
wrap
data SpinButtonWrapPropertyInfo Source #
constructSpinButtonWrap :: IsSpinButton o => Bool -> IO (GValueConstruct o) Source #
getSpinButtonWrap :: (MonadIO m, IsSpinButton o) => o -> m Bool Source #
setSpinButtonWrap :: (MonadIO m, IsSpinButton o) => o -> Bool -> m () Source #
spinButtonWrap :: AttrLabelProxy "wrap" Source #
Signals
changeValue
type SpinButtonChangeValueCallback = ScrollType -> IO () Source #
afterSpinButtonChangeValue :: (GObject a, MonadIO m) => a -> SpinButtonChangeValueCallback -> m SignalHandlerId Source #
mk_SpinButtonChangeValueCallback :: C_SpinButtonChangeValueCallback -> IO (FunPtr C_SpinButtonChangeValueCallback) Source #
onSpinButtonChangeValue :: (GObject a, MonadIO m) => a -> SpinButtonChangeValueCallback -> m SignalHandlerId Source #
wrap_SpinButtonChangeValueCallback :: SpinButtonChangeValueCallback -> Ptr () -> CUInt -> Ptr () -> IO () Source #
input
afterSpinButtonInput :: (GObject a, MonadIO m) => a -> SpinButtonInputCallback -> m SignalHandlerId Source #
mk_SpinButtonInputCallback :: C_SpinButtonInputCallback -> IO (FunPtr C_SpinButtonInputCallback) Source #
onSpinButtonInput :: (GObject a, MonadIO m) => a -> SpinButtonInputCallback -> m SignalHandlerId Source #
wrap_SpinButtonInputCallback :: SpinButtonInputCallback -> Ptr () -> Ptr CDouble -> Ptr () -> IO Int32 Source #
output
type SpinButtonOutputCallback = IO Bool Source #
afterSpinButtonOutput :: (GObject a, MonadIO m) => a -> SpinButtonOutputCallback -> m SignalHandlerId Source #
mk_SpinButtonOutputCallback :: C_SpinButtonOutputCallback -> IO (FunPtr C_SpinButtonOutputCallback) Source #
onSpinButtonOutput :: (GObject a, MonadIO m) => a -> SpinButtonOutputCallback -> m SignalHandlerId Source #
wrap_SpinButtonOutputCallback :: SpinButtonOutputCallback -> Ptr () -> Ptr () -> IO CInt Source #
valueChanged
type SpinButtonValueChangedCallback = IO () Source #
afterSpinButtonValueChanged :: (GObject a, MonadIO m) => a -> SpinButtonValueChangedCallback -> m SignalHandlerId Source #
mk_SpinButtonValueChangedCallback :: C_SpinButtonValueChangedCallback -> IO (FunPtr C_SpinButtonValueChangedCallback) Source #
onSpinButtonValueChanged :: (GObject a, MonadIO m) => a -> SpinButtonValueChangedCallback -> m SignalHandlerId Source #
wrap_SpinButtonValueChangedCallback :: SpinButtonValueChangedCallback -> Ptr () -> Ptr () -> IO () Source #
wrapped
type SpinButtonWrappedCallback = IO () Source #
afterSpinButtonWrapped :: (GObject a, MonadIO m) => a -> SpinButtonWrappedCallback -> m SignalHandlerId Source #
mk_SpinButtonWrappedCallback :: C_SpinButtonWrappedCallback -> IO (FunPtr C_SpinButtonWrappedCallback) Source #
onSpinButtonWrapped :: (GObject a, MonadIO m) => a -> SpinButtonWrappedCallback -> m SignalHandlerId Source #
wrap_SpinButtonWrappedCallback :: SpinButtonWrappedCallback -> Ptr () -> Ptr () -> IO () Source #