gi-gtk3-3.0.44: Gtk 3.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.ScaleButton

Contents

- Exported types
- Methods
  - getAdjustment
  - getMinusButton
  - getPlusButton
  - getPopup
  - getValue
  - new
  - setAdjustment
  - setIcons
  - setValue
- Properties
  - adjustment
  - icons
  - size
  - value
- Signals
  - popdown
  - popup
  - valueChanged

Description

`ScaleButton` provides a button which pops up a scale widget. This kind of widget is commonly used for volume controls in multimedia applications, and GTK+ provides a `VolumeButton` subclass that is tailored for this use case.

# CSS nodes

GtkScaleButton has a single CSS node with name button. To differentiate it from a plain `Button`, it gets the .scale style class.

The popup widget that contains the scale has a .scale-popup style class.

Synopsis

- newtype ScaleButton = ScaleButton (ManagedPtr ScaleButton)
- class (GObject o, IsDescendantOf ScaleButton o) => IsScaleButton o
- toScaleButton :: (MonadIO m, IsScaleButton o) => o -> m ScaleButton
- scaleButtonGetAdjustment :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> m Adjustment
- scaleButtonGetMinusButton :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> m Button
- scaleButtonGetPlusButton :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> m Button
- scaleButtonGetPopup :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> m Widget
- scaleButtonGetValue :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> m Double
- scaleButtonNew :: (HasCallStack, MonadIO m) => Int32 -> Double -> Double -> Double -> Maybe [Text] -> m ScaleButton
- scaleButtonSetAdjustment :: (HasCallStack, MonadIO m, IsScaleButton a, IsAdjustment b) => a -> b -> m ()
- scaleButtonSetIcons :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> [Text] -> m ()
- scaleButtonSetValue :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> Double -> m ()
- constructScaleButtonAdjustment :: (IsScaleButton o, MonadIO m, IsAdjustment a) => a -> m (GValueConstruct o)
- getScaleButtonAdjustment :: (MonadIO m, IsScaleButton o) => o -> m Adjustment
- setScaleButtonAdjustment :: (MonadIO m, IsScaleButton o, IsAdjustment a) => o -> a -> m ()
- constructScaleButtonIcons :: (IsScaleButton o, MonadIO m) => [Text] -> m (GValueConstruct o)
- getScaleButtonIcons :: (MonadIO m, IsScaleButton o) => o -> m (Maybe [Text])
- setScaleButtonIcons :: (MonadIO m, IsScaleButton o) => o -> [Text] -> m ()
- constructScaleButtonSize :: (IsScaleButton o, MonadIO m) => IconSize -> m (GValueConstruct o)
- getScaleButtonSize :: (MonadIO m, IsScaleButton o) => o -> m IconSize
- setScaleButtonSize :: (MonadIO m, IsScaleButton o) => o -> IconSize -> m ()
- constructScaleButtonValue :: (IsScaleButton o, MonadIO m) => Double -> m (GValueConstruct o)
- getScaleButtonValue :: (MonadIO m, IsScaleButton o) => o -> m Double
- setScaleButtonValue :: (MonadIO m, IsScaleButton o) => o -> Double -> m ()
- type ScaleButtonPopdownCallback = IO ()
- afterScaleButtonPopdown :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonPopdownCallback) -> m SignalHandlerId
- onScaleButtonPopdown :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonPopdownCallback) -> m SignalHandlerId
- type ScaleButtonPopupCallback = IO ()
- afterScaleButtonPopup :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonPopupCallback) -> m SignalHandlerId
- onScaleButtonPopup :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonPopupCallback) -> m SignalHandlerId
- type ScaleButtonValueChangedCallback = Double -> IO ()
- afterScaleButtonValueChanged :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonValueChangedCallback) -> m SignalHandlerId
- onScaleButtonValueChanged :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonValueChangedCallback) -> m SignalHandlerId

# Exported types

newtype ScaleButton Source #

Memory-managed wrapper type.

Constructors

ScaleButton (ManagedPtr ScaleButton) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf ScaleButton o) => IsScaleButton o Source #

Type class for types which can be safely cast to `ScaleButton`, for instance with `toScaleButton`.

#### Instances

Instances details

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

toScaleButton :: (MonadIO m, IsScaleButton o) => o -> m ScaleButton Source #

Cast to `ScaleButton`, 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, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, clicked, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, doSetRelatedAction, 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, ensureStyle, enter, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, leave, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, pressed, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, released, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, syncActionProperties, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.

#### Getters

getAccessible, getActionGroup, getActionName, getActionTargetValue, getAdjustment, getAlignment, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAlwaysShowImage, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEventWindow, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getImage, getImagePosition, getInternalChild, getLabel, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getMinusButton, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getOrientation, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPlusButton, getPointer, getPopup, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRelatedAction, getRelief, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getUseActionAppearance, getUseStock, getUseUnderline, getValign, getValignWithBaseline, getValue, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.

#### Setters

setAccelPath, setActionName, setActionTargetValue, setAdjustment, setAlignment, setAllocation, setAlwaysShowImage, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDetailedActionName, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setIcons, setImage, setImagePosition, setLabel, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setRelatedAction, setRelief, setResizeMode, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setUseActionAppearance, setUseStock, setUseUnderline, setValign, setValue, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.

## getAdjustment

scaleButtonGetAdjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsScaleButton a) |
=> a | `button`: a `ScaleButton`
-> m Adjustment | Returns: the adjustment associated with the scale

Gets the `Adjustment` associated with the `ScaleButton`’s scale. See `rangeGetAdjustment` for details.

Since: 2.12

## getMinusButton

scaleButtonGetMinusButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsScaleButton a) |
=> a | `button`: a `ScaleButton`
-> m Button | Returns: the minus button of the `ScaleButton` as a `Button`

Retrieves the minus button of the `ScaleButton`.

Since: 2.14

## getPlusButton

scaleButtonGetPlusButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsScaleButton a) |
=> a | `button`: a `ScaleButton`
-> m Button | Returns: the plus button of the `ScaleButton` as a `Button`

Retrieves the plus button of the `ScaleButton`.

Since: 2.14

## getPopup

scaleButtonGetPopup Source #

Arguments

:: (HasCallStack, MonadIO m, IsScaleButton a) |
=> a | `button`: a `ScaleButton`
-> m Widget | Returns: the popup of the `ScaleButton`

Retrieves the popup of the `ScaleButton`.

Since: 2.14

## getValue

scaleButtonGetValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsScaleButton a) |
=> a | `button`: a `ScaleButton`
-> m Double | Returns: current value of the scale button

Gets the current value of the scale button.

Since: 2.12

## new

scaleButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Int32 | `size`: a stock icon size (t`IconSize`)
-> Double | `min`: the minimum value of the scale (usually 0)
-> Double | `max`: the maximum value of the scale (usually 100)
-> Double | `step`: the stepping of value when a scroll-wheel event, or up/down arrow event occurs (usually 2)
-> Maybe [Text] | `icons`: a `Nothing`-terminated array of icon names, or `Nothing` if you want to set the list later with `scaleButtonSetIcons`
-> m ScaleButton | Returns: a new `ScaleButton`

Creates a `ScaleButton`, with a range between `min` and `max`, with a stepping of `step`.

Since: 2.12

## setAdjustment

scaleButtonSetAdjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsScaleButton a, IsAdjustment b) |
=> a | `button`: a `ScaleButton`
-> b | `adjustment`: a `Adjustment`
-> m () |

Sets the `Adjustment` to be used as a model for the `ScaleButton`’s scale. See `rangeSetAdjustment` for details.

Since: 2.12

## setIcons

scaleButtonSetIcons Source #

Arguments

:: (HasCallStack, MonadIO m, IsScaleButton a) |
=> a | `button`: a `ScaleButton`
-> [Text] | `icons`: a `Nothing`-terminated array of icon names
-> m () |

Sets the icons to be used by the scale button. For details, see the ScaleButton:icons property.

Since: 2.12

## setValue

scaleButtonSetValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsScaleButton a) |
=> a | `button`: a `ScaleButton`
-> Double | `value`: new value of the scale button
-> m () |

Sets the current value of the scale; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them. The scale button emits the ScaleButton::valueChanged signal if the value changes.

Since: 2.12

# Properties

## adjustment

No description available in the introspection data.

constructScaleButtonAdjustment :: (IsScaleButton 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`.

getScaleButtonAdjustment :: (MonadIO m, IsScaleButton o) => o -> m Adjustment Source #

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

    get scaleButton #adjustment

setScaleButtonAdjustment :: (MonadIO m, IsScaleButton o, IsAdjustment a) => o -> a -> m () Source #

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

    set scaleButton [ #adjustment := value ]

## icons

The names of the icons to be used by the scale button. The first item in the array will be used in the button when the current value is the lowest value, the second item for the highest value. All the subsequent icons will be used for all the other values, spread evenly over the range of values.

If there's only one icon name in the `icons` array, it will be used for all the values. If only two icon names are in the `icons` array, the first one will be used for the bottom 50% of the scale, and the second one for the top 50%.

It is recommended to use at least 3 icons so that the `ScaleButton` reflects the current value of the scale better for the users.

Since: 2.12

constructScaleButtonIcons :: (IsScaleButton o, MonadIO m) => [Text] -> m (GValueConstruct o) Source #

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

getScaleButtonIcons :: (MonadIO m, IsScaleButton o) => o -> m (Maybe [Text]) Source #

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

    get scaleButton #icons

setScaleButtonIcons :: (MonadIO m, IsScaleButton o) => o -> [Text] -> m () Source #

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

    set scaleButton [ #icons := value ]

## size

No description available in the introspection data.

constructScaleButtonSize :: (IsScaleButton o, MonadIO m) => IconSize -> m (GValueConstruct o) Source #

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

getScaleButtonSize :: (MonadIO m, IsScaleButton o) => o -> m IconSize Source #

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

    get scaleButton #size

setScaleButtonSize :: (MonadIO m, IsScaleButton o) => o -> IconSize -> m () Source #

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

    set scaleButton [ #size := value ]

## value

No description available in the introspection data.

constructScaleButtonValue :: (IsScaleButton 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`.

getScaleButtonValue :: (MonadIO m, IsScaleButton o) => o -> m Double Source #

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

    get scaleButton #value

setScaleButtonValue :: (MonadIO m, IsScaleButton o) => o -> Double -> m () Source #

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

    set scaleButton [ #value := value ]

# Signals

## popdown

type ScaleButtonPopdownCallback = IO () Source #

The popdown signal is a [keybinding signal][GtkBindingSignal] which gets emitted to popdown the scale widget.

The default binding for this signal is Escape.

Since: 2.12

afterScaleButtonPopdown :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonPopdownCallback) -> m SignalHandlerId Source #

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

    after scaleButton #popdown 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.

onScaleButtonPopdown :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonPopdownCallback) -> m SignalHandlerId Source #

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

    on scaleButton #popdown callback

## popup

type ScaleButtonPopupCallback = IO () Source #

The popup signal is a [keybinding signal][GtkBindingSignal] which gets emitted to popup the scale widget.

The default bindings for this signal are Space, Enter and Return.

Since: 2.12

afterScaleButtonPopup :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonPopupCallback) -> m SignalHandlerId Source #

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

    after scaleButton #popup 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.

onScaleButtonPopup :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonPopupCallback) -> m SignalHandlerId Source #

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

    on scaleButton #popup callback

## valueChanged

type ScaleButtonValueChangedCallback Source #

Arguments

= Double | `value`: the new value
-> IO () |

The valueChanged signal is emitted when the value field has changed.

Since: 2.12

afterScaleButtonValueChanged :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonValueChangedCallback) -> 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 scaleButton #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.

onScaleButtonValueChanged :: (IsScaleButton a, MonadIO m) => a -> ((?self :: a) => ScaleButtonValueChangedCallback) -> 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 scaleButton #valueChanged callback