| 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
Description
GtkScaleButton 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.
Shortcuts and Gestures
The following signals have default keybindings:
CSS nodes
scalebutton.scale
╰── button.toggle
╰── <icon>GtkScaleButton has a single CSS node with name scalebutton and .scale
style class, and contains a button node with a .toggle style class.
Synopsis
- newtype ScaleButton = ScaleButton (ManagedPtr ScaleButton)
- class (GObject o, IsDescendantOf ScaleButton o) => IsScaleButton o
- toScaleButton :: (MonadIO m, IsScaleButton o) => o -> m ScaleButton
- scaleButtonGetActive :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> m Bool
- scaleButtonGetAdjustment :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> m Adjustment
- scaleButtonGetHasFrame :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> m Bool
- 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) => Double -> Double -> Double -> Maybe [Text] -> m ScaleButton
- scaleButtonSetAdjustment :: (HasCallStack, MonadIO m, IsScaleButton a, IsAdjustment b) => a -> b -> m ()
- scaleButtonSetHasFrame :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> Bool -> m ()
- scaleButtonSetIcons :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> [Text] -> m ()
- scaleButtonSetValue :: (HasCallStack, MonadIO m, IsScaleButton a) => a -> Double -> m ()
- getScaleButtonActive :: (MonadIO m, IsScaleButton o) => o -> m Bool
- 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 ()
- constructScaleButtonHasFrame :: (IsScaleButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getScaleButtonHasFrame :: (MonadIO m, IsScaleButton o) => o -> m Bool
- setScaleButtonHasFrame :: (MonadIO m, IsScaleButton o) => o -> Bool -> 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 ()
- 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
| Eq ScaleButton Source # | |
Defined in GI.Gtk.Objects.ScaleButton | |
| GObject ScaleButton Source # | |
Defined in GI.Gtk.Objects.ScaleButton | |
| ManagedPtrNewtype ScaleButton Source # | |
Defined in GI.Gtk.Objects.ScaleButton Methods | |
| TypedObject ScaleButton Source # | |
Defined in GI.Gtk.Objects.ScaleButton | |
| HasParentTypes ScaleButton Source # | |
Defined in GI.Gtk.Objects.ScaleButton | |
| IsGValue (Maybe ScaleButton) Source # | Convert |
Defined in GI.Gtk.Objects.ScaleButton Methods gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe ScaleButton -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe ScaleButton) # | |
| type ParentTypes ScaleButton Source # | |
Defined in GI.Gtk.Objects.ScaleButton type ParentTypes ScaleButton = '[Widget, Object, Accessible, AccessibleRange, Buildable, ConstraintTarget, 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
| (GObject o, IsDescendantOf ScaleButton o) => IsScaleButton o Source # | |
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
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, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getActive, getAdjustment, 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, getHasFrame, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMinusButton, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOrientation, getOverflow, getPangoContext, getParent, getPlatformState, getPlusButton, getPopup, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getValue, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setAdjustment, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasFrame, setHasTooltip, setHexpand, setHexpandSet, setIcons, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOrientation, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setValue, setVexpand, setVexpandSet, setVisible.
getActive
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> m Bool | Returns: whether the button is pressed |
getAdjustment
scaleButtonGetAdjustment Source #
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> m Adjustment | Returns: the adjustment associated with the scale |
Gets the GtkAdjustment associated with the GtkScaleButton’s scale.
See rangeGetAdjustment for details.
getHasFrame
scaleButtonGetHasFrame Source #
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> m Bool | Returns: |
Returns whether the button has a frame.
Since: 4.14
getMinusButton
scaleButtonGetMinusButton Source #
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> m Button | Returns: the minus button
of the |
Retrieves the minus button of the GtkScaleButton.
getPlusButton
scaleButtonGetPlusButton Source #
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> m Button | Returns: the plus button
of the |
Retrieves the plus button of the GtkScaleButton.
getPopup
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> m Widget | Returns: the popup of the |
Retrieves the popup of the GtkScaleButton.
getValue
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> m Double | Returns: current value of the scale button |
Gets the current value of the scale button.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Double |
|
| -> Double |
|
| -> Double |
|
| -> Maybe [Text] |
|
| -> m ScaleButton | Returns: a new |
Creates a GtkScaleButton.
The new scale button has a range between min and max,
with a stepping of step.
setAdjustment
scaleButtonSetAdjustment Source #
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a, IsAdjustment b) | |
| => a |
|
| -> b |
|
| -> m () |
Sets the GtkAdjustment to be used as a model
for the GtkScaleButton’s scale.
See rangeSetAdjustment for details.
setHasFrame
scaleButtonSetHasFrame Source #
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> Bool |
|
| -> m () |
Sets the style of the button.
Since: 4.14
setIcons
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> [Text] |
|
| -> m () |
Sets the icons to be used by the scale button.
setValue
Arguments
| :: (HasCallStack, MonadIO m, IsScaleButton a) | |
| => a |
|
| -> Double |
|
| -> 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.
Properties
active
If the scale button should be pressed in.
Since: 4.10
getScaleButtonActive :: (MonadIO m, IsScaleButton o) => o -> m Bool Source #
Get the value of the “active” property.
When overloading is enabled, this is equivalent to
get scaleButton #active
adjustment
The GtkAdjustment that is used as the model.
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
setscaleButton [ #adjustment:=value ]
hasFrame
If the scale button has a frame.
Since: 4.14
constructScaleButtonHasFrame :: (IsScaleButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “has-frame” property. This is rarely needed directly, but it is used by new.
getScaleButtonHasFrame :: (MonadIO m, IsScaleButton o) => o -> m Bool Source #
Get the value of the “has-frame” property.
When overloading is enabled, this is equivalent to
get scaleButton #hasFrame
setScaleButtonHasFrame :: (MonadIO m, IsScaleButton o) => o -> Bool -> m () Source #
Set the value of the “has-frame” property.
When overloading is enabled, this is equivalent to
setscaleButton [ #hasFrame:=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
GtkScaleButton reflects the current value of the scale
better for the users.
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
setscaleButton [ #icons:=value ]
value
The value of the scale.
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
setscaleButton [ #value:=value ]
Signals
popdown
type ScaleButtonPopdownCallback = IO () Source #
Emitted to dismiss the popup.
This is a keybinding signal.
The default binding for this signal is <kbd>Escape</kbd>.
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 #
Emitted to popup the scale widget.
This is a keybinding signal.
The default bindings for this signal are <kbd>Space</kbd>, <kbd>Enter</kbd> and <kbd>Return</kbd>.
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 #
Emitted when the value field has changed.
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