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

Contents

- Exported types
- Methods
  - getChild
  - getObeyChild
  - getRatio
  - getXalign
  - getYalign
  - new
  - setChild
  - setObeyChild
  - setRatio
  - setXalign
  - setYalign
- Properties
  - child
  - obeyChild
  - ratio
  - xalign
  - yalign

Description

Preserves the aspect ratio of its child.

The frame can respect the aspect ratio of the child widget, or use its own aspect ratio.

# CSS nodes

`GtkAspectFrame` uses a CSS node with name `aspectframe`.

# Accessibility

Until GTK 4.10, `GtkAspectFrame` used the `AccessibleRoleGroup` role.

Starting from GTK 4.12, `GtkAspectFrame` uses the `AccessibleRoleGeneric` role.

Synopsis

- newtype AspectFrame = AspectFrame (ManagedPtr AspectFrame)
- class (GObject o, IsDescendantOf AspectFrame o) => IsAspectFrame o
- toAspectFrame :: (MonadIO m, IsAspectFrame o) => o -> m AspectFrame
- aspectFrameGetChild :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m (Maybe Widget)
- aspectFrameGetObeyChild :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m Bool
- aspectFrameGetRatio :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m Float
- aspectFrameGetXalign :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m Float
- aspectFrameGetYalign :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m Float
- aspectFrameNew :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Bool -> m AspectFrame
- aspectFrameSetChild :: (HasCallStack, MonadIO m, IsAspectFrame a, IsWidget b) => a -> Maybe b -> m ()
- aspectFrameSetObeyChild :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Bool -> m ()
- aspectFrameSetRatio :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Float -> m ()
- aspectFrameSetXalign :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Float -> m ()
- aspectFrameSetYalign :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Float -> m ()
- clearAspectFrameChild :: (MonadIO m, IsAspectFrame o) => o -> m ()
- constructAspectFrameChild :: (IsAspectFrame o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getAspectFrameChild :: (MonadIO m, IsAspectFrame o) => o -> m (Maybe Widget)
- setAspectFrameChild :: (MonadIO m, IsAspectFrame o, IsWidget a) => o -> a -> m ()
- constructAspectFrameObeyChild :: (IsAspectFrame o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> m Bool
- setAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> Bool -> m ()
- constructAspectFrameRatio :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o)
- getAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> m Float
- setAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> Float -> m ()
- constructAspectFrameXalign :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o)
- getAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> m Float
- setAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m ()
- constructAspectFrameYalign :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o)
- getAspectFrameYalign :: (MonadIO m, IsAspectFrame o) => o -> m Float
- setAspectFrameYalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m ()

# Exported types

newtype AspectFrame Source #

Memory-managed wrapper type.

Constructors

AspectFrame (ManagedPtr AspectFrame) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf AspectFrame o) => IsAspectFrame o Source #

Type class for types which can be safely cast to `AspectFrame`, for instance with `toAspectFrame`.

#### Instances

Instances details

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

toAspectFrame :: (MonadIO m, IsAspectFrame o) => o -> m AspectFrame Source #

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

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getObeyChild, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRatio, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, getXalign, getYalign.

#### Setters

setAccessibleParent, setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setObeyChild, setOpacity, setOverflow, setParent, setProperty, setRatio, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setXalign, setYalign.

## getChild

aspectFrameGetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> m (Maybe Widget) | Returns: the child widget of `self`

Gets the child widget of `self`.

## getObeyChild

aspectFrameGetObeyChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> m Bool | Returns: whether to obey the child's size request

Returns whether the child's size request should override the set aspect ratio of the `GtkAspectFrame`.

## getRatio

aspectFrameGetRatio Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> m Float | Returns: the desired aspect ratio

Returns the desired aspect ratio of the child.

## getXalign

aspectFrameGetXalign Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> m Float | Returns: the horizontal alignment

Returns the horizontal alignment of the child within the allocation of the `GtkAspectFrame`.

## getYalign

aspectFrameGetYalign Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> m Float | Returns: the vertical alignment

Returns the vertical alignment of the child within the allocation of the `GtkAspectFrame`.

## new

aspectFrameNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Float | `xalign`: Horizontal alignment of the child within the parent. Ranges from 0.0 (left aligned) to 1.0 (right aligned)
-> Float | `yalign`: Vertical alignment of the child within the parent. Ranges from 0.0 (top aligned) to 1.0 (bottom aligned)
-> Float | `ratio`: The desired aspect ratio.
-> Bool | `obeyChild`: If `True`, `ratio` is ignored, and the aspect ratio is taken from the requistion of the child.
-> m AspectFrame | Returns: the new `GtkAspectFrame`.

Create a new `GtkAspectFrame`.

## setChild

aspectFrameSetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a, IsWidget b) |
=> a | `self`: a `GtkAspectFrame`
-> Maybe b | `child`: the child widget
-> m () |

Sets the child widget of `self`.

## setObeyChild

aspectFrameSetObeyChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> Bool | `obeyChild`: If `True`, `ratio` is ignored, and the aspect ratio is taken from the requisition of the child.
-> m () |

Sets whether the aspect ratio of the child's size request should override the set aspect ratio of the `GtkAspectFrame`.

## setRatio

aspectFrameSetRatio Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> Float | `ratio`: aspect ratio of the child
-> m () |

Sets the desired aspect ratio of the child.

## setXalign

aspectFrameSetXalign Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> Float | `xalign`: horizontal alignment, from 0.0 (left aligned) to 1.0 (right aligned)
-> m () |

Sets the horizontal alignment of the child within the allocation of the `GtkAspectFrame`.

## setYalign

aspectFrameSetYalign Source #

Arguments

:: (HasCallStack, MonadIO m, IsAspectFrame a) |
=> a | `self`: a `GtkAspectFrame`
-> Float | `yalign`: horizontal alignment, from 0.0 (top aligned) to 1.0 (bottom aligned)
-> m () |

Sets the vertical alignment of the child within the allocation of the `GtkAspectFrame`.

# Properties

## child

The child widget.

clearAspectFrameChild :: (MonadIO m, IsAspectFrame o) => o -> m () Source #

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

    clear #child

constructAspectFrameChild :: (IsAspectFrame o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

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

getAspectFrameChild :: (MonadIO m, IsAspectFrame o) => o -> m (Maybe Widget) Source #

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

    get aspectFrame #child

setAspectFrameChild :: (MonadIO m, IsAspectFrame o, IsWidget a) => o -> a -> m () Source #

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

    set aspectFrame [ #child := value ]

## obeyChild

Whether the `GtkAspectFrame` should use the aspect ratio of its child.

constructAspectFrameObeyChild :: (IsAspectFrame o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> m Bool Source #

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

    get aspectFrame #obeyChild

setAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> Bool -> m () Source #

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

    set aspectFrame [ #obeyChild := value ]

## ratio

The aspect ratio to be used by the `GtkAspectFrame`.

This property is only used if AspectFrame:obeyChild is set to `False`.

constructAspectFrameRatio :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o) Source #

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

getAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> m Float Source #

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

    get aspectFrame #ratio

setAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> Float -> m () Source #

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

    set aspectFrame [ #ratio := value ]

## xalign

The horizontal alignment of the child.

constructAspectFrameXalign :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o) Source #

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

getAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> m Float Source #

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

    get aspectFrame #xalign

setAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m () Source #

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

    set aspectFrame [ #xalign := value ]

## yalign

The vertical alignment of the child.

constructAspectFrameYalign :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o) Source #

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

getAspectFrameYalign :: (MonadIO m, IsAspectFrame o) => o -> m Float Source #

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

    get aspectFrame #yalign

setAspectFrameYalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m () Source #

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

    set aspectFrame [ #yalign := value ]