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.CustomLayout

Contents

- Exported types
- Methods
  - new

Description

Uses closures for size negotiation.

A `GtkCustomLayout` uses closures matching to the old `GtkWidget` virtual functions for size negotiation, as a convenience API to ease the porting towards the corresponding `GtkLayoutManager` virtual functions.

Synopsis

- newtype CustomLayout = CustomLayout (ManagedPtr CustomLayout)
- class (GObject o, IsDescendantOf CustomLayout o) => IsCustomLayout o
- toCustomLayout :: (MonadIO m, IsCustomLayout o) => o -> m CustomLayout
- customLayoutNew :: (HasCallStack, MonadIO m) => Maybe CustomRequestModeFunc -> CustomMeasureFunc -> CustomAllocateFunc -> m CustomLayout

# Exported types

newtype CustomLayout Source #

Memory-managed wrapper type.

Constructors

CustomLayout (ManagedPtr CustomLayout) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf CustomLayout o) => IsCustomLayout o Source #

Type class for types which can be safely cast to `CustomLayout`, for instance with `toCustomLayout`.

#### Instances

Instances details

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

toCustomLayout :: (MonadIO m, IsCustomLayout o) => o -> m CustomLayout Source #

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

getData, getLayoutChild, getProperty, getQdata, getRequestMode, getWidget.

#### Setters

setData, setDataFull, setProperty.

## new

customLayoutNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Maybe CustomRequestModeFunc | `requestMode`: a function to retrieve the `GtkSizeRequestMode` of the widget using the layout; the default request mode is `SizeRequestModeConstantSize`
-> CustomMeasureFunc | `measure`: a function to measure the widget using the layout manager
-> CustomAllocateFunc | `allocate`: a function to allocate the children of the widget using the layout manager
-> m CustomLayout | Returns: the newly created `GtkCustomLayout`

Creates a new legacy layout manager.

Legacy layout managers map to the old `GtkWidget` size negotiation virtual functions, and are meant to be used during the transition from layout containers to layout manager delegates.