gi-gtk-3.0.27: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Range

Contents

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 influencing the sensitivity of the “steppers”. It also 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
GObject Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

Methods

gobjectType :: Range -> IO GType #

IsImplementorIface Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

IsObject Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

IsBuildable Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

IsOrientable Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

IsRange Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

IsWidget Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

class GObject o => IsRange o Source #

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

Instances
(GObject a, (UnknownAncestorError Range a :: Constraint)) => IsRange a Source # 
Instance details

Defined in GI.Gtk.Objects.Range

IsRange Range Source # 
Instance details

Defined in GI.Gtk.Objects.Range

IsRange Scale Source # 
Instance details

Defined in GI.Gtk.Objects.Scale

IsRange Scrollbar Source # 
Instance details

Defined in GI.Gtk.Objects.Scrollbar

IsRange VScrollbar Source # 
Instance details

Defined in GI.Gtk.Objects.VScrollbar

IsRange VScale Source # 
Instance details

Defined in GI.Gtk.Objects.VScale

IsRange HScrollbar Source # 
Instance details

Defined in GI.Gtk.Objects.HScrollbar

IsRange HScale Source # 
Instance details

Defined in GI.Gtk.Objects.HScale

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.

noRange :: Maybe Range Source #

A convenience alias for Nothing :: Maybe Range.

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.

Since: 2.12

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.

Since: 2.18

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.

getLowerStepperSensitivity

rangeGetLowerStepperSensitivity Source #

Arguments

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

range: a Range

-> m SensitivityType

Returns: The lower stepper’s sensitivity policy.

Gets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange’s adjustment.

Since: 2.10

getMinSliderSize

rangeGetMinSliderSize Source #

Arguments

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

range: a Range

-> m Int32

Returns: The minimum size of the range’s slider.

Deprecated: (Since version 3.20)Use the min-height/min-width CSS properties on the slider node.

This function is useful mainly for Range subclasses.

See rangeSetMinSliderSize.

Since: 2.20

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 and its steppers, in widget->window coordinates.

This function is useful mainly for Range subclasses.

Since: 2.20

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.

Since: 2.12

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 Range::change-value.

Since: 2.24

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.

Since: 2.12

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.

Since: 2.20

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.

Since: 2.20

getUpperStepperSensitivity

rangeGetUpperStepperSensitivity Source #

Arguments

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

range: a Range

-> m SensitivityType

Returns: The upper stepper’s sensitivity policy.

Gets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange’s adjustment.

Since: 2.10

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.

Since: 2.12

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.

Since: 2.18

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.

setLowerStepperSensitivity

rangeSetLowerStepperSensitivity Source #

Arguments

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

range: a Range

-> SensitivityType

sensitivity: the lower stepper’s sensitivity policy.

-> m () 

Sets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange’s adjustment.

Since: 2.10

setMinSliderSize

rangeSetMinSliderSize Source #

Arguments

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

range: a Range

-> Int32

minSize: The slider’s minimum size

-> m () 

Deprecated: (Since version 3.20)Use the min-height/min-width CSS properties on the slider node.

Sets the minimum size of the range’s slider.

This function is useful mainly for Range subclasses.

Since: 2.20

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.

Since: 2.12

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 Range::change-value.

Since: 2.24

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.

Since: 2.12

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.

Since: 2.20

setUpperStepperSensitivity

rangeSetUpperStepperSensitivity Source #

Arguments

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

range: a Range

-> SensitivityType

sensitivity: the upper stepper’s sensitivity policy.

-> m () 

Sets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange’s adjustment.

Since: 2.10

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 Range::value-changed signal if the value changes.

Properties

adjustment

No description available in the introspection data.

constructRangeAdjustment :: (IsRange o, IsAdjustment a) => a -> IO (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.

Since: 2.12

constructRangeFillLevel :: IsRange o => Double -> IO (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 => Bool -> IO (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 ]

lowerStepperSensitivity

No description available in the introspection data.

constructRangeLowerStepperSensitivity :: IsRange o => SensitivityType -> IO (GValueConstruct o) Source #

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

getRangeLowerStepperSensitivity :: (MonadIO m, IsRange o) => o -> m SensitivityType Source #

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

get range #lowerStepperSensitivity

setRangeLowerStepperSensitivity :: (MonadIO m, IsRange o) => o -> SensitivityType -> m () Source #

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

set range [ #lowerStepperSensitivity := 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.

Since: 2.12

constructRangeRestrictToFillLevel :: IsRange o => Bool -> IO (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 Range::change-value.

Since: 2.24

constructRangeRoundDigits :: IsRange o => Int32 -> IO (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.

Since: 2.12

constructRangeShowFillLevel :: IsRange o => Bool -> IO (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 ]

upperStepperSensitivity

No description available in the introspection data.

constructRangeUpperStepperSensitivity :: IsRange o => SensitivityType -> IO (GValueConstruct o) Source #

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

getRangeUpperStepperSensitivity :: (MonadIO m, IsRange o) => o -> m SensitivityType Source #

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

get range #upperStepperSensitivity

setRangeUpperStepperSensitivity :: (MonadIO m, IsRange o) => o -> SensitivityType -> m () Source #

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

set range [ #upperStepperSensitivity := 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 “adjust-bounds” 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 “adjust-bounds” 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 Range::change-value 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::change-value 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.

Since: 2.6

afterRangeChangeValue :: (IsRange a, MonadIO m) => a -> RangeChangeValueCallback -> m SignalHandlerId Source #

Connect a signal handler for the “change-value” 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 “change-value” 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 “move-slider” 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 “move-slider” 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 “value-changed” 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 “value-changed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on range #valueChanged callback