gi-gtk-4.0.2: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Range

Description

Range is the common base class for widgets which visualize an adjustment, e.g Scale or Scrollbar.

Apart from signals for monitoring the parameters of the adjustment, Range provides properties and methods for setting a “fill level” on range widgets. See rangeSetFillLevel.

Synopsis

Exported types

newtype Range Source #

Memory-managed wrapper type.

Constructors

Range (ManagedPtr Range) 

Instances

Instances details
Eq Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

Methods

(==) :: Range -> Range -> Bool #

(/=) :: Range -> Range -> Bool #

IsGValue Range Source #

Convert Range to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Range

ManagedPtrNewtype Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

TypedObject Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

Methods

glibType :: IO GType #

GObject Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

HasParentTypes Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

type ParentTypes Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

type ParentTypes Range = '[Widget, Object, ImplementorIface, Buildable, ConstraintTarget, Orientable]

class (GObject o, IsDescendantOf Range o) => IsRange o Source #

Type class for types which can be safely cast to Range, for instance with toRange.

Instances

Instances details
(GObject o, IsDescendantOf Range o) => IsRange o Source # 
Instance details

Defined in GI.Gtk.Objects.Range

toRange :: (MonadIO m, IsRange o) => o -> m Range Source #

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

Methods

Overloaded methods

getAdjustment

rangeGetAdjustment Source #

Arguments

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

range: a Range

-> m Adjustment

Returns: a Adjustment

Get the Adjustment which is the “model” object for Range. See rangeSetAdjustment for details. The return value does not have a reference added, so should not be unreferenced.

getFillLevel

rangeGetFillLevel Source #

Arguments

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

range: A Range

-> m Double

Returns: The current fill level

Gets the current position of the fill level indicator.

getFlippable

rangeGetFlippable Source #

Arguments

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

range: a Range

-> m Bool

Returns: True if the range is flippable

Gets the value set by rangeSetFlippable.

getInverted

rangeGetInverted Source #

Arguments

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

range: a Range

-> m Bool

Returns: True if the range is inverted

Gets the value set by rangeSetInverted.

getRangeRect

rangeGetRangeRect Source #

Arguments

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

range: a Range

-> m Rectangle 

This function returns the area that contains the range’s trough, in coordinates relative to range's origin.

This function is useful mainly for Range subclasses.

getRestrictToFillLevel

rangeGetRestrictToFillLevel Source #

Arguments

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

range: A Range

-> m Bool

Returns: True if range is restricted to the fill level.

Gets whether the range is restricted to the fill level.

getRoundDigits

rangeGetRoundDigits Source #

Arguments

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

range: a Range

-> m Int32

Returns: the number of digits to round to

Gets the number of digits to round the value to when it changes. See changeValue.

getShowFillLevel

rangeGetShowFillLevel Source #

Arguments

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

range: A Range

-> m Bool

Returns: True if range shows the fill level.

Gets whether the range displays the fill level graphically.

getSliderRange

rangeGetSliderRange Source #

Arguments

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

range: a Range

-> m (Int32, Int32) 

This function returns sliders range along the long dimension, in widget->window coordinates.

This function is useful mainly for Range subclasses.

getSliderSizeFixed

rangeGetSliderSizeFixed Source #

Arguments

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

range: a Range

-> m Bool

Returns: whether the range’s slider has a fixed size.

This function is useful mainly for Range subclasses.

See rangeSetSliderSizeFixed.

getValue

rangeGetValue Source #

Arguments

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

range: a Range

-> m Double

Returns: current value of the range.

Gets the current value of the range.

setAdjustment

rangeSetAdjustment Source #

Arguments

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

range: a Range

-> b

adjustment: a Adjustment

-> m () 

Sets the adjustment to be used as the “model” object for this range widget. The adjustment indicates the current range value, the minimum and maximum range values, the step/page increments used for keybindings and scrolling, and the page size. The page size is normally 0 for Scale and nonzero for Scrollbar, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.

setFillLevel

rangeSetFillLevel Source #

Arguments

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

range: a Range

-> Double

fillLevel: the new position of the fill level indicator

-> m () 

Set the new position of the fill level indicator.

The “fill level” is probably best described by its most prominent use case, which is an indicator for the amount of pre-buffering in a streaming media player. In that use case, the value of the range would indicate the current play position, and the fill level would be the position up to which the file/stream has been downloaded.

This amount of prebuffering can be displayed on the range’s trough and is themeable separately from the trough. To enable fill level display, use rangeSetShowFillLevel. The range defaults to not showing the fill level.

Additionally, it’s possible to restrict the range’s slider position to values which are smaller than the fill level. This is controller by rangeSetRestrictToFillLevel and is by default enabled.

setFlippable

rangeSetFlippable Source #

Arguments

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

range: a Range

-> Bool

flippable: True to make the range flippable

-> m () 

If a range is flippable, it will switch its direction if it is horizontal and its direction is TextDirectionRtl.

See widgetGetDirection.

setIncrements

rangeSetIncrements Source #

Arguments

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

range: a Range

-> Double

step: step size

-> Double

page: page size

-> m () 

Sets the step and page sizes for the range. The step size is used when the user clicks the Scrollbar arrows or moves Scale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

setInverted

rangeSetInverted Source #

Arguments

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

range: a Range

-> Bool

setting: True to invert the range

-> m () 

Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the right rather than on the bottom or left.

setRange

rangeSetRange Source #

Arguments

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

range: a Range

-> Double

min: minimum range value

-> Double

max: maximum range value

-> m () 

Sets the allowable values in the Range, and clamps the range value to be between min and max. (If the range has a non-zero page size, it is clamped between min and max - page-size.)

setRestrictToFillLevel

rangeSetRestrictToFillLevel Source #

Arguments

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

range: A Range

-> Bool

restrictToFillLevel: Whether the fill level restricts slider movement.

-> m () 

Sets whether the slider is restricted to the fill level. See rangeSetFillLevel for a general description of the fill level concept.

setRoundDigits

rangeSetRoundDigits Source #

Arguments

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

range: a Range

-> Int32

roundDigits: the precision in digits, or -1

-> m () 

Sets the number of digits to round the value to when it changes. See changeValue.

setShowFillLevel

rangeSetShowFillLevel Source #

Arguments

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

range: A Range

-> Bool

showFillLevel: Whether a fill level indicator graphics is shown.

-> m () 

Sets whether a graphical fill level is show on the trough. See rangeSetFillLevel for a general description of the fill level concept.

setSliderSizeFixed

rangeSetSliderSizeFixed Source #

Arguments

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

range: a Range

-> Bool

sizeFixed: True to make the slider size constant

-> m () 

Sets whether the range’s slider has a fixed size, or a size that depends on its adjustment’s page size.

This function is useful mainly for Range subclasses.

setValue

rangeSetValue Source #

Arguments

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

range: a Range

-> Double

value: new value of the range

-> m () 

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

Properties

adjustment

No description available in the introspection data.

constructRangeAdjustment :: (IsRange 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.

getRangeAdjustment :: (MonadIO m, IsRange o) => o -> m Adjustment Source #

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

get range #adjustment

setRangeAdjustment :: (MonadIO m, IsRange o, IsAdjustment a) => o -> a -> m () Source #

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

set range [ #adjustment := value ]

fillLevel

The fill level (e.g. prebuffering of a network stream). See rangeSetFillLevel.

constructRangeFillLevel :: (IsRange o, MonadIO m) => Double -> m (GValueConstruct o) Source #

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

getRangeFillLevel :: (MonadIO m, IsRange o) => o -> m Double Source #

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

get range #fillLevel

setRangeFillLevel :: (MonadIO m, IsRange o) => o -> Double -> m () Source #

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

set range [ #fillLevel := value ]

inverted

No description available in the introspection data.

constructRangeInverted :: (IsRange o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getRangeInverted :: (MonadIO m, IsRange o) => o -> m Bool Source #

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

get range #inverted

setRangeInverted :: (MonadIO m, IsRange o) => o -> Bool -> m () Source #

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

set range [ #inverted := value ]

restrictToFillLevel

The restrict-to-fill-level property controls whether slider movement is restricted to an upper boundary set by the fill level. See rangeSetRestrictToFillLevel.

constructRangeRestrictToFillLevel :: (IsRange o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getRangeRestrictToFillLevel :: (MonadIO m, IsRange o) => o -> m Bool Source #

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

get range #restrictToFillLevel

setRangeRestrictToFillLevel :: (MonadIO m, IsRange o) => o -> Bool -> m () Source #

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

set range [ #restrictToFillLevel := value ]

roundDigits

The number of digits to round the value to when it changes, or -1. See changeValue.

constructRangeRoundDigits :: (IsRange o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getRangeRoundDigits :: (MonadIO m, IsRange o) => o -> m Int32 Source #

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

get range #roundDigits

setRangeRoundDigits :: (MonadIO m, IsRange o) => o -> Int32 -> m () Source #

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

set range [ #roundDigits := value ]

showFillLevel

The show-fill-level property controls whether fill level indicator graphics are displayed on the trough. See rangeSetShowFillLevel.

constructRangeShowFillLevel :: (IsRange o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getRangeShowFillLevel :: (MonadIO m, IsRange o) => o -> m Bool Source #

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

get range #showFillLevel

setRangeShowFillLevel :: (MonadIO m, IsRange o) => o -> Bool -> m () Source #

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

set range [ #showFillLevel := value ]

Signals

adjustBounds

type C_RangeAdjustBoundsCallback = Ptr () -> CDouble -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type RangeAdjustBoundsCallback Source #

Arguments

 = Double

value: the value before we clamp

-> IO () 

Emitted before clamping a value, to give the application a chance to adjust the bounds.

afterRangeAdjustBounds :: (IsRange a, MonadIO m) => a -> RangeAdjustBoundsCallback -> m SignalHandlerId Source #

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

after range #adjustBounds callback

onRangeAdjustBounds :: (IsRange a, MonadIO m) => a -> RangeAdjustBoundsCallback -> m SignalHandlerId Source #

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

on range #adjustBounds callback

changeValue

type C_RangeChangeValueCallback = Ptr () -> CUInt -> CDouble -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type RangeChangeValueCallback Source #

Arguments

 = ScrollType

scroll: the type of scroll action that was performed

-> Double

value: the new value resulting from the scroll action

-> IO Bool

Returns: True to prevent other handlers from being invoked for the signal, False to propagate the signal further

The changeValue signal is emitted when a scroll action is performed on a range. It allows an application to determine the type of scroll event that occurred and the resultant new value. The application can handle the event itself and return True to prevent further processing. Or, by returning False, it can pass the event to other handlers until the default GTK+ handler is reached.

The value parameter is unrounded. An application that overrides the GtkRange[changeValue](#g:signal:changeValue) signal is responsible for clamping the value to the desired number of decimal digits; the default GTK+ handler clamps the value based on Range:round-digits.

afterRangeChangeValue :: (IsRange a, MonadIO m) => a -> RangeChangeValueCallback -> 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 range #changeValue callback

onRangeChangeValue :: (IsRange a, MonadIO m) => a -> RangeChangeValueCallback -> 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 range #changeValue callback

moveSlider

type C_RangeMoveSliderCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type RangeMoveSliderCallback Source #

Arguments

 = ScrollType

step: how to move the slider

-> IO () 

Virtual function that moves the slider. Used for keybindings.

afterRangeMoveSlider :: (IsRange a, MonadIO m) => a -> RangeMoveSliderCallback -> m SignalHandlerId Source #

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

after range #moveSlider callback

onRangeMoveSlider :: (IsRange a, MonadIO m) => a -> RangeMoveSliderCallback -> m SignalHandlerId Source #

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

on range #moveSlider callback

valueChanged

type C_RangeValueChangedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type RangeValueChangedCallback = IO () Source #

Emitted when the range value changes.

afterRangeValueChanged :: (IsRange a, MonadIO m) => a -> RangeValueChangedCallback -> 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 range #valueChanged callback

onRangeValueChanged :: (IsRange a, MonadIO m) => a -> RangeValueChangedCallback -> 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 range #valueChanged callback