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.Objects.BoxLayout

Contents

- Exported types
- Methods
  - getBaselineChild
  - getBaselinePosition
  - getHomogeneous
  - getSpacing
  - new
  - setBaselineChild
  - setBaselinePosition
  - setHomogeneous
  - setSpacing
- Properties
  - baselineChild
  - baselinePosition
  - homogeneous
  - spacing

Description

Arranges children in a single row or column.

Whether it is a row or column depends on the value of its Orientable:orientation property. Within the other dimension all children all allocated the same size. The `GtkBoxLayout` will respect the Widget:halign and Widget:valign properties of each child widget.

If you want all children to be assigned the same size, you can use the BoxLayout:homogeneous property.

If you want to specify the amount of space placed between each child, you can use the BoxLayout:spacing property.

Synopsis

- newtype BoxLayout = BoxLayout (ManagedPtr BoxLayout)
- class (GObject o, IsDescendantOf BoxLayout o) => IsBoxLayout o
- toBoxLayout :: (MonadIO m, IsBoxLayout o) => o -> m BoxLayout
- boxLayoutGetBaselineChild :: (HasCallStack, MonadIO m, IsBoxLayout a) => a -> m Int32
- boxLayoutGetBaselinePosition :: (HasCallStack, MonadIO m, IsBoxLayout a) => a -> m BaselinePosition
- boxLayoutGetHomogeneous :: (HasCallStack, MonadIO m, IsBoxLayout a) => a -> m Bool
- boxLayoutGetSpacing :: (HasCallStack, MonadIO m, IsBoxLayout a) => a -> m Word32
- boxLayoutNew :: (HasCallStack, MonadIO m) => Orientation -> m BoxLayout
- boxLayoutSetBaselineChild :: (HasCallStack, MonadIO m, IsBoxLayout a) => a -> Int32 -> m ()
- boxLayoutSetBaselinePosition :: (HasCallStack, MonadIO m, IsBoxLayout a) => a -> BaselinePosition -> m ()
- boxLayoutSetHomogeneous :: (HasCallStack, MonadIO m, IsBoxLayout a) => a -> Bool -> m ()
- boxLayoutSetSpacing :: (HasCallStack, MonadIO m, IsBoxLayout a) => a -> Word32 -> m ()
- constructBoxLayoutBaselineChild :: (IsBoxLayout o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getBoxLayoutBaselineChild :: (MonadIO m, IsBoxLayout o) => o -> m Int32
- setBoxLayoutBaselineChild :: (MonadIO m, IsBoxLayout o) => o -> Int32 -> m ()
- constructBoxLayoutBaselinePosition :: (IsBoxLayout o, MonadIO m) => BaselinePosition -> m (GValueConstruct o)
- getBoxLayoutBaselinePosition :: (MonadIO m, IsBoxLayout o) => o -> m BaselinePosition
- setBoxLayoutBaselinePosition :: (MonadIO m, IsBoxLayout o) => o -> BaselinePosition -> m ()
- constructBoxLayoutHomogeneous :: (IsBoxLayout o, MonadIO m) => Bool -> m (GValueConstruct o)
- getBoxLayoutHomogeneous :: (MonadIO m, IsBoxLayout o) => o -> m Bool
- setBoxLayoutHomogeneous :: (MonadIO m, IsBoxLayout o) => o -> Bool -> m ()
- constructBoxLayoutSpacing :: (IsBoxLayout o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getBoxLayoutSpacing :: (MonadIO m, IsBoxLayout o) => o -> m Int32
- setBoxLayoutSpacing :: (MonadIO m, IsBoxLayout o) => o -> Int32 -> m ()

# Exported types

newtype BoxLayout Source #

Memory-managed wrapper type.

Constructors

BoxLayout (ManagedPtr BoxLayout) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf BoxLayout o) => IsBoxLayout o Source #

Type class for types which can be safely cast to `BoxLayout`, for instance with `toBoxLayout`.

#### Instances

Instances details

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

toBoxLayout :: (MonadIO m, IsBoxLayout o) => o -> m BoxLayout Source #

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

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

#### Getters

getBaselineChild, getBaselinePosition, getData, getHomogeneous, getLayoutChild, getOrientation, getProperty, getQdata, getRequestMode, getSpacing, getWidget.

#### Setters

setBaselineChild, setBaselinePosition, setData, setDataFull, setHomogeneous, setOrientation, setProperty, setSpacing.

## getBaselineChild

boxLayoutGetBaselineChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsBoxLayout a) |
=> a | `boxLayout`: a `GtkBoxLayout`
-> m Int32 | Returns: the index of the child that determines the baseline in vertical layout, or -1

Gets the value set by `boxLayoutSetBaselineChild`.

Since: 4.12

## getBaselinePosition

boxLayoutGetBaselinePosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsBoxLayout a) |
=> a | `boxLayout`: a `GtkBoxLayout`
-> m BaselinePosition | Returns: the baseline position

Gets the value set by `boxLayoutSetBaselinePosition`.

## getHomogeneous

boxLayoutGetHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsBoxLayout a) |
=> a | `boxLayout`: a `GtkBoxLayout`
-> m Bool | Returns: `True` if the layout is homogeneous

Returns whether the layout is set to be homogeneous.

## getSpacing

boxLayoutGetSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsBoxLayout a) |
=> a | `boxLayout`: a `GtkBoxLayout`
-> m Word32 | Returns: the spacing of the layout

Returns the space that `boxLayout` puts between children.

## new

boxLayoutNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Orientation | `orientation`: the orientation for the new layout
-> m BoxLayout | Returns: a new box layout

Creates a new `GtkBoxLayout`.

## setBaselineChild

boxLayoutSetBaselineChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsBoxLayout a) |
=> a | `boxLayout`: a `GtkBoxLayout`
-> Int32 | `child`: the child position, or -1
-> m () |

Sets the index of the child that determines the baseline in vertical layout.

Since: 4.12

## setBaselinePosition

boxLayoutSetBaselinePosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsBoxLayout a) |
=> a | `boxLayout`: a `GtkBoxLayout`
-> BaselinePosition | `position`: a `GtkBaselinePosition`
-> m () |

Sets the baseline position of a box layout.

The baseline position affects only horizontal boxes with at least one baseline aligned child. If there is more vertical space available than requested, and the baseline is not allocated by the parent then the given `position` is used to allocate the baseline within the extra space available.

## setHomogeneous

boxLayoutSetHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsBoxLayout a) |
=> a | `boxLayout`: a `GtkBoxLayout`
-> Bool | `homogeneous`: `True` to set the box layout as homogeneous
-> m () |

Sets whether the box layout will allocate the same size to all children.

## setSpacing

boxLayoutSetSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsBoxLayout a) |
=> a | `boxLayout`: a `GtkBoxLayout`
-> Word32 | `spacing`: the spacing to apply between children
-> m () |

Sets how much spacing to put between children.

# Properties

## baselineChild

The child that determines the baseline of the box in vertical layout.

If the child does baseline positioning, then its baseline is lined up with the baseline of the box. If it doesn't, then the bottom edge of the child is used.

Since: 4.12

constructBoxLayoutBaselineChild :: (IsBoxLayout o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getBoxLayoutBaselineChild :: (MonadIO m, IsBoxLayout o) => o -> m Int32 Source #

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

    get boxLayout #baselineChild

setBoxLayoutBaselineChild :: (MonadIO m, IsBoxLayout o) => o -> Int32 -> m () Source #

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

    set boxLayout [ #baselineChild := value ]

## baselinePosition

The position of the allocated baseline within the extra space allocated to each child.

This property is only relevant for horizontal layouts containing at least one child with a baseline alignment.

constructBoxLayoutBaselinePosition :: (IsBoxLayout o, MonadIO m) => BaselinePosition -> m (GValueConstruct o) Source #

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

getBoxLayoutBaselinePosition :: (MonadIO m, IsBoxLayout o) => o -> m BaselinePosition Source #

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

    get boxLayout #baselinePosition

setBoxLayoutBaselinePosition :: (MonadIO m, IsBoxLayout o) => o -> BaselinePosition -> m () Source #

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

    set boxLayout [ #baselinePosition := value ]

## homogeneous

Whether the box layout should distribute the available space equally among the children.

constructBoxLayoutHomogeneous :: (IsBoxLayout o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getBoxLayoutHomogeneous :: (MonadIO m, IsBoxLayout o) => o -> m Bool Source #

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

    get boxLayout #homogeneous

setBoxLayoutHomogeneous :: (MonadIO m, IsBoxLayout o) => o -> Bool -> m () Source #

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

    set boxLayout [ #homogeneous := value ]

## spacing

The space to put between the children.

constructBoxLayoutSpacing :: (IsBoxLayout o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getBoxLayoutSpacing :: (MonadIO m, IsBoxLayout o) => o -> m Int32 Source #

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

    get boxLayout #spacing

setBoxLayoutSpacing :: (MonadIO m, IsBoxLayout o) => o -> Int32 -> m () Source #

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

    set boxLayout [ #spacing := value ]