gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.Spinner

Contents

- Exported types
- Methods
  - getSpinning
  - new
  - setSpinning
  - start
  - stop
- Properties
  - spinning

Description

Displays an icon-size spinning animation.

It is often used as an alternative to a `ProgressBar` for displaying indefinite activity, instead of actual progress.

<picture> <source srcset="spinner-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkSpinner" src="spinner.png"> </picture>

To start the animation, use `spinnerStart`, to stop it use `spinnerStop`.

# CSS nodes

`GtkSpinner` has a single CSS node with the name spinner. When the animation is active, the :checked pseudoclass is added to this node.

# Accessibility

`GtkSpinner` uses the `AccessibleRoleProgressBar` role.

Synopsis

- newtype Spinner = Spinner (ManagedPtr Spinner)
- class (GObject o, IsDescendantOf Spinner o) => IsSpinner o
- toSpinner :: (MonadIO m, IsSpinner o) => o -> m Spinner
- spinnerGetSpinning :: (HasCallStack, MonadIO m, IsSpinner a) => a -> m Bool
- spinnerNew :: (HasCallStack, MonadIO m) => m Spinner
- spinnerSetSpinning :: (HasCallStack, MonadIO m, IsSpinner a) => a -> Bool -> m ()
- spinnerStart :: (HasCallStack, MonadIO m, IsSpinner a) => a -> m ()
- spinnerStop :: (HasCallStack, MonadIO m, IsSpinner a) => a -> m ()
- constructSpinnerSpinning :: (IsSpinner o, MonadIO m) => Bool -> m (GValueConstruct o)
- getSpinnerSpinning :: (MonadIO m, IsSpinner o) => o -> m Bool
- setSpinnerSpinning :: (MonadIO m, IsSpinner o) => o -> Bool -> m ()

# Exported types

newtype Spinner Source #

Memory-managed wrapper type.

Constructors

Spinner (ManagedPtr Spinner) |

#### Instances

Instances details

Eq Spinner Source # |
Instance details Defined in GI.Gtk.Objects.Spinner Methods (==) :: Spinner -> Spinner -> Bool Source # (/=) :: Spinner -> Spinner -> Bool Source #
GObject Spinner Source # |
Instance details Defined in GI.Gtk.Objects.Spinner
ManagedPtrNewtype Spinner Source # |
Instance details Defined in GI.Gtk.Objects.Spinner Methods toManagedPtr :: Spinner -> ManagedPtr Spinner Source #
TypedObject Spinner Source # |
Instance details Defined in GI.Gtk.Objects.Spinner Methods glibType :: IO GType Source #
HasParentTypes Spinner Source # |
Instance details Defined in GI.Gtk.Objects.Spinner
IsGValue (Maybe Spinner) Source # | Convert `Spinner` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.Spinner Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Spinner -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Spinner) Source #
type ParentTypes Spinner Source # |
Instance details Defined in GI.Gtk.Objects.Spinner type ParentTypes Spinner = '[Widget, Object, Accessible, Buildable, ConstraintTarget]

class (GObject o, IsDescendantOf Spinner o) => IsSpinner o Source #

Type class for types which can be safely cast to `Spinner`, for instance with `toSpinner`.

#### Instances

Instances details

(GObject o, IsDescendantOf Spinner o) => IsSpinner o Source # |
Instance details Defined in GI.Gtk.Objects.Spinner

toSpinner :: (MonadIO m, IsSpinner o) => o -> m Spinner Source #

Cast to `Spinner`, 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

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, start, stealData, stealQdata, stop, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getSpinning, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setSpinning, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

## getSpinning

spinnerGetSpinning Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinner a) |
=> a | `spinner`: a `GtkSpinner`
-> m Bool | Returns: `True` if the spinner is active

Returns whether the spinner is spinning.

## new

spinnerNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Spinner | Returns: a new `GtkSpinner`

Returns a new spinner widget. Not yet started.

## setSpinning

spinnerSetSpinning Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinner a) |
=> a | `spinner`: a `GtkSpinner`
-> Bool | `spinning`: whether the spinner should be spinning
-> m () |

Sets the activity of the spinner.

## start

spinnerStart Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinner a) |
=> a | `spinner`: a `GtkSpinner`
-> m () |

Starts the animation of the spinner.

## stop

spinnerStop Source #

Arguments

:: (HasCallStack, MonadIO m, IsSpinner a) |
=> a | `spinner`: a `GtkSpinner`
-> m () |

Stops the animation of the spinner.

# Properties

## spinning

Whether the spinner is spinning

constructSpinnerSpinning :: (IsSpinner o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getSpinnerSpinning :: (MonadIO m, IsSpinner o) => o -> m Bool Source #

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

    get spinner #spinning

setSpinnerSpinning :: (MonadIO m, IsSpinner o) => o -> Bool -> m () Source #

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

    set spinner [ #spinning := value ]