gi-gtk-3.0.41: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.SpinButton

Description

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:widthChars and Entry:maxWidthChars poperties to the desired number of characters to display in the entry.

CSS nodes

plain code

spinbutton.horizontal
├── undershoot.left
├── undershoot.right
├── entry
│   ╰── ...
├── button.down
╰── button.up

plain code

spinbutton.vertical
├── undershoot.left
├── undershoot.right
├── 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);
}
Synopsis

Exported types

newtype SpinButton Source #

Memory-managed wrapper type.

Constructors

SpinButton (ManagedPtr SpinButton) 

Instances

Instances details
Eq SpinButton Source # 
Instance details

Defined in GI.Gtk.Objects.SpinButton

GObject SpinButton Source # 
Instance details

Defined in GI.Gtk.Objects.SpinButton

ManagedPtrNewtype SpinButton Source # 
Instance details

Defined in GI.Gtk.Objects.SpinButton

Methods

toManagedPtr :: SpinButton -> ManagedPtr SpinButton

TypedObject SpinButton Source # 
Instance details

Defined in GI.Gtk.Objects.SpinButton

Methods

glibType :: IO GType

HasParentTypes SpinButton Source # 
Instance details

Defined in GI.Gtk.Objects.SpinButton

IsGValue (Maybe SpinButton) Source #

Convert SpinButton to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.SpinButton

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe SpinButton -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe SpinButton)

type ParentTypes SpinButton Source # 
Instance details

Defined in GI.Gtk.Objects.SpinButton

type ParentTypes SpinButton = '[Entry, Widget, Object, ImplementorIface, Buildable, CellEditable, Editable, Orientable]

class (GObject o, IsDescendantOf SpinButton o) => IsSpinButton o Source #

Type class for types which can be safely cast to SpinButton, for instance with toSpinButton.

Instances

Instances details
(GObject o, IsDescendantOf SpinButton o) => IsSpinButton o Source # 
Instance details

Defined in GI.Gtk.Objects.SpinButton

toSpinButton :: (MonadIO m, IsSpinButton o) => o -> m SpinButton Source #

Cast to SpinButton, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

activate, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, childFocus, childNotify, classPath, computeExpand, configure, constructChild, copyClipboard, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, cutClipboard, deleteSelection, deleteText, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, editingDone, ensureStyle, errorBell, event, forceFloating, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabFocusWithoutSelecting, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, imContextFilterKeypress, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, insertText, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, layoutIndexToTextIndex, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, pasteClipboard, path, progressPulse, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, removeAccelerator, removeMnemonicLabel, removeTickCallback, removeWidget, renderIcon, renderIconPixbuf, reparent, resetImContext, resetRcStyles, resetStyle, runDispose, selectRegion, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, spin, startEditing, stealData, stealQdata, styleAttach, styleGetProperty, textIndexToLayoutIndex, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetInvisibleChar, unsetStateFlags, update, watchClosure.

Getters

getAccessible, getActionGroup, getActivatesDefault, getAdjustment, getAlignment, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getAttributes, getBuffer, getCanDefault, getCanFocus, getChars, getChildRequisition, getChildVisible, getClip, getClipboard, getCompletion, getCompositeName, getCurrentIconDragSource, getCursorHadjustment, getData, getDeviceEnabled, getDeviceEvents, getDigits, getDirection, getDisplay, getDoubleBuffered, getEditable, getEvents, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasFrame, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getIconActivatable, getIconArea, getIconAtPos, getIconGicon, getIconName, getIconPixbuf, getIconSensitive, getIconStock, getIconStorageType, getIconTooltipMarkup, getIconTooltipText, getIncrements, getInnerBorder, getInputHints, getInputPurpose, getInternalChild, getInvisibleChar, getLayout, getLayoutOffsets, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getMaxLength, getMaxWidthChars, getModifierMask, getModifierStyle, getName, getNoShowAll, getNumeric, getOpacity, getOrientation, getOverwriteMode, getPangoContext, getParent, getParentWindow, getPath, getPlaceholderText, getPointer, getPosition, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProgressFraction, getProgressPulseStep, getProperty, getQdata, getRange, getRealized, getReceivesDefault, getRequestMode, getRequisition, getRootWindow, getScaleFactor, getScreen, getSelectionBounds, getSensitive, getSettings, getSizeRequest, getSnapToTicks, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTabs, getTemplateChild, getText, getTextArea, getTextLength, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getUpdatePolicy, getValign, getValignWithBaseline, getValue, getValueAsInt, getVexpand, getVexpandSet, getVisibility, getVisible, getVisual, getWidthChars, getWindow, getWrap.

Setters

setAccelPath, setActivatesDefault, setAdjustment, setAlignment, setAllocation, setAppPaintable, setAttributes, setBuffer, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompletion, setCompositeName, setCursorHadjustment, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDigits, setDirection, setDoubleBuffered, setEditable, setEvents, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasFrame, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setIconActivatable, setIconDragSource, setIconFromGicon, setIconFromIconName, setIconFromPixbuf, setIconFromStock, setIconSensitive, setIconTooltipMarkup, setIconTooltipText, setIncrements, setInnerBorder, setInputHints, setInputPurpose, setInvisibleChar, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setMaxLength, setMaxWidthChars, setName, setNoShowAll, setNumeric, setOpacity, setOrientation, setOverwriteMode, setParent, setParentWindow, setPlaceholderText, setPosition, setProgressFraction, setProgressPulseStep, setProperty, setRange, setRealized, setReceivesDefault, setRedrawOnAllocate, setSensitive, setSizeRequest, setSnapToTicks, setState, setStateFlags, setStyle, setSupportMultidevice, setTabs, setText, setTooltipMarkup, setTooltipText, setTooltipWindow, setUpdatePolicy, setValign, setValue, setVexpand, setVexpandSet, setVisibility, setVisible, setVisual, setWidthChars, setWindow, setWrap.

configure

spinButtonConfigure Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a, IsAdjustment b) 
=> a

spinButton: a SpinButton

-> Maybe b

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

-> Double

climbRate: the new climb rate

-> Word32

digits: the number of decimal places to display in the spin button

-> m () 

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

getAdjustment

spinButtonGetAdjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m Adjustment

Returns: the Adjustment of spinButton

Get the adjustment associated with a SpinButton

getDigits

spinButtonGetDigits Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m Word32

Returns: the current precision

Fetches the precision of spinButton. See spinButtonSetDigits.

getIncrements

spinButtonGetIncrements Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m (Double, Double) 

Gets the current step and page the increments used by spinButton. See spinButtonSetIncrements.

getNumeric

spinButtonGetNumeric Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m Bool

Returns: True if only numeric text can be entered

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

getRange

spinButtonGetRange Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m (Double, Double) 

Gets the range allowed for spinButton. See spinButtonSetRange.

getSnapToTicks

spinButtonGetSnapToTicks Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m Bool

Returns: True if values are snapped to the nearest step

Returns whether the values are corrected to the nearest step. See spinButtonSetSnapToTicks.

getUpdatePolicy

spinButtonGetUpdatePolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m SpinButtonUpdatePolicy

Returns: the current update policy

Gets the update behavior of a spin button. See spinButtonSetUpdatePolicy.

getValue

spinButtonGetValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m Double

Returns: the value of spinButton

Get the value in the spinButton.

getValueAsInt

spinButtonGetValueAsInt Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m Int32

Returns: the value of spinButton

Get the value spinButton represented as an integer.

getWrap

spinButtonGetWrap Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m Bool

Returns: True if the spin button wraps around

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

spinButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsAdjustment a) 
=> Maybe a

adjustment: the Adjustment object that this spin button should use, or Nothing

-> Double

climbRate: 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

-> Word32

digits: the number of decimal places to display

-> m SpinButton

Returns: The new spin button as a Widget

Creates a new SpinButton.

newWithRange

spinButtonNewWithRange Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Double

min: Minimum allowable value

-> Double

max: Maximum allowable value

-> Double

step: Increment added or subtracted by spinning the widget

-> m SpinButton

Returns: The new spin button as a Widget

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

spinButtonSetAdjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a, IsAdjustment b) 
=> a

spinButton: a SpinButton

-> b

adjustment: a Adjustment to replace the existing adjustment

-> m () 

Replaces the Adjustment associated with spinButton.

setDigits

spinButtonSetDigits Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> Word32

digits: the number of digits after the decimal point to be displayed for the spin button’s value

-> m () 

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

setIncrements

spinButtonSetIncrements Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> Double

step: increment applied for a button 1 press.

-> Double

page: increment applied for a button 2 press.

-> 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

spinButtonSetNumeric Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> Bool

numeric: flag indicating if only numeric entry is allowed

-> m () 

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

setRange

spinButtonSetRange Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> Double

min: minimum allowable value

-> Double

max: maximum allowable value

-> 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

spinButtonSetSnapToTicks Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> Bool

snapToTicks: a flag indicating if invalid values should be corrected

-> 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

spinButtonSetUpdatePolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> SpinButtonUpdatePolicy

policy: a SpinButtonUpdatePolicy value

-> 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

spinButtonSetValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> Double

value: the new value

-> m () 

Sets the value of spinButton.

setWrap

spinButtonSetWrap Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> Bool

wrap: a flag indicating if wrapping behavior is performed

-> 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

spinButtonSpin Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> SpinType

direction: a SpinType indicating the direction to spin

-> Double

increment: step increment to apply in the specified direction

-> m () 

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

update

spinButtonUpdate Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinButton a) 
=> a

spinButton: a SpinButton

-> m () 

Manually force an update of the spin button.

Properties

adjustment

No description available in the introspection data.

constructSpinButtonAdjustment :: (IsSpinButton o, MonadIO m, IsAdjustment a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “adjustment” property. This is rarely needed directly, but it is used by new.

getSpinButtonAdjustment :: (MonadIO m, IsSpinButton o) => o -> m Adjustment Source #

Get the value of the “adjustment” property. When overloading is enabled, this is equivalent to

get spinButton #adjustment

setSpinButtonAdjustment :: (MonadIO m, IsSpinButton o, IsAdjustment a) => o -> a -> m () Source #

Set the value of the “adjustment” property. When overloading is enabled, this is equivalent to

set spinButton [ #adjustment := value ]

climbRate

No description available in the introspection data.

constructSpinButtonClimbRate :: (IsSpinButton o, MonadIO m) => Double -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “climb-rate” property. This is rarely needed directly, but it is used by new.

getSpinButtonClimbRate :: (MonadIO m, IsSpinButton o) => o -> m Double Source #

Get the value of the “climb-rate” property. When overloading is enabled, this is equivalent to

get spinButton #climbRate

setSpinButtonClimbRate :: (MonadIO m, IsSpinButton o) => o -> Double -> m () Source #

Set the value of the “climb-rate” property. When overloading is enabled, this is equivalent to

set spinButton [ #climbRate := value ]

digits

No description available in the introspection data.

constructSpinButtonDigits :: (IsSpinButton o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “digits” property. This is rarely needed directly, but it is used by new.

getSpinButtonDigits :: (MonadIO m, IsSpinButton o) => o -> m Word32 Source #

Get the value of the “digits” property. When overloading is enabled, this is equivalent to

get spinButton #digits

setSpinButtonDigits :: (MonadIO m, IsSpinButton o) => o -> Word32 -> m () Source #

Set the value of the “digits” property. When overloading is enabled, this is equivalent to

set spinButton [ #digits := value ]

numeric

No description available in the introspection data.

constructSpinButtonNumeric :: (IsSpinButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “numeric” property. This is rarely needed directly, but it is used by new.

getSpinButtonNumeric :: (MonadIO m, IsSpinButton o) => o -> m Bool Source #

Get the value of the “numeric” property. When overloading is enabled, this is equivalent to

get spinButton #numeric

setSpinButtonNumeric :: (MonadIO m, IsSpinButton o) => o -> Bool -> m () Source #

Set the value of the “numeric” property. When overloading is enabled, this is equivalent to

set spinButton [ #numeric := value ]

snapToTicks

No description available in the introspection data.

constructSpinButtonSnapToTicks :: (IsSpinButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “snap-to-ticks” property. This is rarely needed directly, but it is used by new.

getSpinButtonSnapToTicks :: (MonadIO m, IsSpinButton o) => o -> m Bool Source #

Get the value of the “snap-to-ticks” property. When overloading is enabled, this is equivalent to

get spinButton #snapToTicks

setSpinButtonSnapToTicks :: (MonadIO m, IsSpinButton o) => o -> Bool -> m () Source #

Set the value of the “snap-to-ticks” property. When overloading is enabled, this is equivalent to

set spinButton [ #snapToTicks := value ]

updatePolicy

No description available in the introspection data.

constructSpinButtonUpdatePolicy :: (IsSpinButton o, MonadIO m) => SpinButtonUpdatePolicy -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “update-policy” property. This is rarely needed directly, but it is used by new.

getSpinButtonUpdatePolicy :: (MonadIO m, IsSpinButton o) => o -> m SpinButtonUpdatePolicy Source #

Get the value of the “update-policy” property. When overloading is enabled, this is equivalent to

get spinButton #updatePolicy

setSpinButtonUpdatePolicy :: (MonadIO m, IsSpinButton o) => o -> SpinButtonUpdatePolicy -> m () Source #

Set the value of the “update-policy” property. When overloading is enabled, this is equivalent to

set spinButton [ #updatePolicy := value ]

value

No description available in the introspection data.

constructSpinButtonValue :: (IsSpinButton o, MonadIO m) => Double -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “value” property. This is rarely needed directly, but it is used by new.

getSpinButtonValue :: (MonadIO m, IsSpinButton o) => o -> m Double Source #

Get the value of the “value” property. When overloading is enabled, this is equivalent to

get spinButton #value

setSpinButtonValue :: (MonadIO m, IsSpinButton o) => o -> Double -> m () Source #

Set the value of the “value” property. When overloading is enabled, this is equivalent to

set spinButton [ #value := value ]

wrap

No description available in the introspection data.

constructSpinButtonWrap :: (IsSpinButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “wrap” property. This is rarely needed directly, but it is used by new.

getSpinButtonWrap :: (MonadIO m, IsSpinButton o) => o -> m Bool Source #

Get the value of the “wrap” property. When overloading is enabled, this is equivalent to

get spinButton #wrap

setSpinButtonWrap :: (MonadIO m, IsSpinButton o) => o -> Bool -> m () Source #

Set the value of the “wrap” property. When overloading is enabled, this is equivalent to

set spinButton [ #wrap := value ]

Signals

changeValue

type SpinButtonChangeValueCallback Source #

Arguments

 = ScrollType

scroll: a ScrollType to specify the speed and amount of change

-> IO () 

The changeValue signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user initiates a value change.

Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically.

The default bindings for this signal are Up/Down and PageUp and/PageDown.

afterSpinButtonChangeValue :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonChangeValueCallback) -> m SignalHandlerId Source #

Connect a signal handler for the changeValue signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after spinButton #changeValue callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSpinButtonChangeValue :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonChangeValueCallback) -> m SignalHandlerId Source #

Connect a signal handler for the changeValue signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on spinButton #changeValue callback

input

type SpinButtonInputCallback Source #

Arguments

 = IO (Int32, Double)

Returns: True for a successful conversion, False if the input was not handled, and INPUT_ERROR if the conversion failed.

The input signal can be used to influence the conversion of the users input into a double value. The signal handler is expected to use entryGetText to retrieve the text of the entry and set newValue to the new value.

The default conversion uses strtod.

afterSpinButtonInput :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonInputCallback) -> m SignalHandlerId Source #

Connect a signal handler for the input signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after spinButton #input callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSpinButtonInput :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonInputCallback) -> m SignalHandlerId Source #

Connect a signal handler for the input signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on spinButton #input callback

output

type SpinButtonOutputCallback Source #

Arguments

 = IO Bool

Returns: True if the value has been displayed

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

C code

// show leading zeros
static gboolean
on_output (GtkSpinButton *spin,
           gpointer       data)
{
   GtkAdjustment *adjustment;
   gchar *text;
   int value;

   adjustment = gtk_spin_button_get_adjustment (spin);
   value = (int)gtk_adjustment_get_value (adjustment);
   text = g_strdup_printf ("%02d", value);
   gtk_entry_set_text (GTK_ENTRY (spin), text);
   g_free (text);

   return TRUE;
}

afterSpinButtonOutput :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonOutputCallback) -> m SignalHandlerId Source #

Connect a signal handler for the output signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after spinButton #output callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSpinButtonOutput :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonOutputCallback) -> m SignalHandlerId Source #

Connect a signal handler for the output signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on spinButton #output callback

valueChanged

type SpinButtonValueChangedCallback = IO () Source #

The valueChanged signal is emitted when the value represented by spinbutton changes. Also see the SpinButton::output signal.

afterSpinButtonValueChanged :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonValueChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the valueChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after spinButton #valueChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSpinButtonValueChanged :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonValueChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the valueChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on spinButton #valueChanged callback

wrapped

type SpinButtonWrappedCallback = IO () Source #

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

Since: 2.10

afterSpinButtonWrapped :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonWrappedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the wrapped signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after spinButton #wrapped callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSpinButtonWrapped :: (IsSpinButton a, MonadIO m) => a -> ((?self :: a) => SpinButtonWrappedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the wrapped signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on spinButton #wrapped callback