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.Interfaces.Scrollable

Contents

- Exported types
- Methods
  - getBorder
  - getHadjustment
  - getHscrollPolicy
  - getVadjustment
  - getVscrollPolicy
  - setHadjustment
  - setHscrollPolicy
  - setVadjustment
  - setVscrollPolicy
- Properties
  - hadjustment
  - hscrollPolicy
  - vadjustment
  - vscrollPolicy

Description

An interface for widgets with native scrolling ability.

To implement this interface you should override the Scrollable:hadjustment and Scrollable:vadjustment properties.

## Creating a scrollable widget

All scrollable widgets should do the following.

- When a parent widget sets the scrollable child widget’s adjustments, the widget should connect to the Adjustment::valueChanged signal. The child widget should then populate the adjustments’ properties as soon as possible, which usually means queueing an allocation right away and populating the properties in the `Widget`.`size_allocate`() implementation.
- Because its preferred size is the size for a fully expanded widget, the scrollable widget must be able to cope with underallocations. This means that it must accept any value passed to its `Widget`.`size_allocate`() implementation.
- When the parent allocates space to the scrollable child widget, the widget must ensure the adjustments’ property values are correct and up to date, for example using `adjustmentConfigure`.
- When any of the adjustments emits the Adjustment::valueChanged signal, the scrollable widget should scroll its contents.

Synopsis

- newtype Scrollable = Scrollable (ManagedPtr Scrollable)
- class (GObject o, IsDescendantOf Scrollable o) => IsScrollable o
- toScrollable :: (MonadIO m, IsScrollable o) => o -> m Scrollable
- scrollableGetBorder :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m (Bool, Border)
- scrollableGetHadjustment :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m (Maybe Adjustment)
- scrollableGetHscrollPolicy :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m ScrollablePolicy
- scrollableGetVadjustment :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m (Maybe Adjustment)
- scrollableGetVscrollPolicy :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m ScrollablePolicy
- scrollableSetHadjustment :: (HasCallStack, MonadIO m, IsScrollable a, IsAdjustment b) => a -> Maybe b -> m ()
- scrollableSetHscrollPolicy :: (HasCallStack, MonadIO m, IsScrollable a) => a -> ScrollablePolicy -> m ()
- scrollableSetVadjustment :: (HasCallStack, MonadIO m, IsScrollable a, IsAdjustment b) => a -> Maybe b -> m ()
- scrollableSetVscrollPolicy :: (HasCallStack, MonadIO m, IsScrollable a) => a -> ScrollablePolicy -> m ()
- clearScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m ()
- constructScrollableHadjustment :: (IsScrollable o, MonadIO m, IsAdjustment a) => a -> m (GValueConstruct o)
- getScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m (Maybe Adjustment)
- setScrollableHadjustment :: (MonadIO m, IsScrollable o, IsAdjustment a) => o -> a -> m ()
- constructScrollableHscrollPolicy :: (IsScrollable o, MonadIO m) => ScrollablePolicy -> m (GValueConstruct o)
- getScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m ScrollablePolicy
- setScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> ScrollablePolicy -> m ()
- clearScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m ()
- constructScrollableVadjustment :: (IsScrollable o, MonadIO m, IsAdjustment a) => a -> m (GValueConstruct o)
- getScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m (Maybe Adjustment)
- setScrollableVadjustment :: (MonadIO m, IsScrollable o, IsAdjustment a) => o -> a -> m ()
- constructScrollableVscrollPolicy :: (IsScrollable o, MonadIO m) => ScrollablePolicy -> m (GValueConstruct o)
- getScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m ScrollablePolicy
- setScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> ScrollablePolicy -> m ()

# Exported types

newtype Scrollable Source #

Memory-managed wrapper type.

Constructors

Scrollable (ManagedPtr Scrollable) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf Scrollable o) => IsScrollable o Source #

Type class for types which can be safely cast to `Scrollable`, for instance with `toScrollable`.

#### Instances

Instances details

(GObject o, IsDescendantOf Scrollable o) => IsScrollable o Source # |
Instance details Defined in GI.Gtk.Interfaces.Scrollable

toScrollable :: (MonadIO m, IsScrollable o) => o -> m Scrollable Source #

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

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getBorder, getData, getHadjustment, getHscrollPolicy, getProperty, getQdata, getVadjustment, getVscrollPolicy.

#### Setters

setData, setDataFull, setHadjustment, setHscrollPolicy, setProperty, setVadjustment, setVscrollPolicy.

## getBorder

scrollableGetBorder Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a) |
=> a | `scrollable`: a `GtkScrollable`
-> m (Bool, Border) | Returns: `True` if `border` has been set

Returns the size of a non-scrolling border around the outside of the scrollable.

An example for this would be treeview headers. GTK can use this information to display overlaid graphics, like the overshoot indication, at the right position.

## getHadjustment

scrollableGetHadjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a) |
=> a | `scrollable`: a `GtkScrollable`
-> m (Maybe Adjustment) | Returns: horizontal `GtkAdjustment`.

Retrieves the `GtkAdjustment` used for horizontal scrolling.

## getHscrollPolicy

scrollableGetHscrollPolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a) |
=> a | `scrollable`: a `GtkScrollable`
-> m ScrollablePolicy | Returns: The horizontal `GtkScrollablePolicy`.

Gets the horizontal `GtkScrollablePolicy`.

## getVadjustment

scrollableGetVadjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a) |
=> a | `scrollable`: a `GtkScrollable`
-> m (Maybe Adjustment) | Returns: vertical `GtkAdjustment`.

Retrieves the `GtkAdjustment` used for vertical scrolling.

## getVscrollPolicy

scrollableGetVscrollPolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a) |
=> a | `scrollable`: a `GtkScrollable`
-> m ScrollablePolicy | Returns: The vertical `GtkScrollablePolicy`.

Gets the vertical `GtkScrollablePolicy`.

## setHadjustment

scrollableSetHadjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a, IsAdjustment b) |
=> a | `scrollable`: a `GtkScrollable`
-> Maybe b | `hadjustment`: a `GtkAdjustment`
-> m () |

Sets the horizontal adjustment of the `GtkScrollable`.

## setHscrollPolicy

scrollableSetHscrollPolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a) |
=> a | `scrollable`: a `GtkScrollable`
-> ScrollablePolicy | `policy`: the horizontal `GtkScrollablePolicy`
-> m () |

Sets the `GtkScrollablePolicy`.

The policy determines whether horizontal scrolling should start below the minimum width or below the natural width.

## setVadjustment

scrollableSetVadjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a, IsAdjustment b) |
=> a | `scrollable`: a `GtkScrollable`
-> Maybe b | `vadjustment`: a `GtkAdjustment`
-> m () |

Sets the vertical adjustment of the `GtkScrollable`.

## setVscrollPolicy

scrollableSetVscrollPolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollable a) |
=> a | `scrollable`: a `GtkScrollable`
-> ScrollablePolicy | `policy`: the vertical `GtkScrollablePolicy`
-> m () |

Sets the `GtkScrollablePolicy`.

The policy determines whether vertical scrolling should start below the minimum height or below the natural height.

# Properties

## hadjustment

Horizontal `GtkAdjustment` of the scrollable widget.

This adjustment is shared between the scrollable widget and its parent.

clearScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m () Source #

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

    clear #hadjustment

constructScrollableHadjustment :: (IsScrollable o, MonadIO m, IsAdjustment a) => a -> m (GValueConstruct o) Source #

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

getScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m (Maybe Adjustment) Source #

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

    get scrollable #hadjustment

setScrollableHadjustment :: (MonadIO m, IsScrollable o, IsAdjustment a) => o -> a -> m () Source #

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

    set scrollable [ #hadjustment := value ]

## hscrollPolicy

Determines when horizontal scrolling should start.

constructScrollableHscrollPolicy :: (IsScrollable o, MonadIO m) => ScrollablePolicy -> m (GValueConstruct o) Source #

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

getScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m ScrollablePolicy Source #

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

    get scrollable #hscrollPolicy

setScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> ScrollablePolicy -> m () Source #

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

    set scrollable [ #hscrollPolicy := value ]

## vadjustment

Vertical `GtkAdjustment` of the scrollable widget.

This adjustment is shared between the scrollable widget and its parent.

clearScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m () Source #

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

    clear #vadjustment

constructScrollableVadjustment :: (IsScrollable o, MonadIO m, IsAdjustment a) => a -> m (GValueConstruct o) Source #

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

getScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m (Maybe Adjustment) Source #

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

    get scrollable #vadjustment

setScrollableVadjustment :: (MonadIO m, IsScrollable o, IsAdjustment a) => o -> a -> m () Source #

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

    set scrollable [ #vadjustment := value ]

## vscrollPolicy

Determines when vertical scrolling should start.

constructScrollableVscrollPolicy :: (IsScrollable o, MonadIO m) => ScrollablePolicy -> m (GValueConstruct o) Source #

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

getScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m ScrollablePolicy Source #

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

    get scrollable #vscrollPolicy

setScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> ScrollablePolicy -> m () Source #

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

    set scrollable [ #vscrollPolicy := value ]