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

Contents

- Exported types
- Methods
  - getChildPosition
  - getChildTransform
  - move
  - new
  - put
  - remove
  - setChildTransform

Description

Places its child widgets at fixed positions and with fixed sizes.

`GtkFixed` performs no automatic layout management.

For most applications, you should not use this container! It keeps you from having to learn about the other GTK containers, but it results in broken applications. With `GtkFixed`, the following things will result in truncated text, overlapping widgets, and other display bugs:

- Themes, which may change widget sizes.
- Fonts other than the one you used to write the app will of course change the size of widgets containing text; keep in mind that users may use a larger font because of difficulty reading the default, or they may be using a different OS that provides different fonts.
- Translation of text into other languages changes its size. Also, display of non-English text will use a different font in many cases.

In addition, `GtkFixed` does not pay attention to text direction and thus may produce unwanted results if your app is run under right-to-left languages such as Hebrew or Arabic. That is: normally GTK will order containers appropriately for the text direction, e.g. to put labels to the right of the thing they label when using an RTL language, but it can’t do that with `GtkFixed`. So if you need to reorder widgets depending on the text direction, you would need to manually detect it and adjust child positions accordingly.

Finally, fixed positioning makes it kind of annoying to add/remove UI elements, since you have to reposition all the other elements. This is a long-term maintenance problem for your application.

If you know none of these things are an issue for your application, and prefer the simplicity of `GtkFixed`, by all means use the widget. But you should be aware of the tradeoffs.

Synopsis

- newtype Fixed = Fixed (ManagedPtr Fixed)
- class (GObject o, IsDescendantOf Fixed o) => IsFixed o
- toFixed :: (MonadIO m, IsFixed o) => o -> m Fixed
- fixedGetChildPosition :: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) => a -> b -> m (Double, Double)
- fixedGetChildTransform :: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) => a -> b -> m (Maybe Transform)
- fixedMove :: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) => a -> b -> Double -> Double -> m ()
- fixedNew :: (HasCallStack, MonadIO m) => m Fixed
- fixedPut :: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) => a -> b -> Double -> Double -> m ()
- fixedRemove :: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) => a -> b -> m ()
- fixedSetChildTransform :: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) => a -> b -> Maybe Transform -> m ()

# Exported types

newtype Fixed Source #

Memory-managed wrapper type.

Constructors

Fixed (ManagedPtr Fixed) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf Fixed o) => IsFixed o Source #

Type class for types which can be safely cast to `Fixed`, for instance with `toFixed`.

#### Instances

Instances details

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

toFixed :: (MonadIO m, IsFixed o) => o -> m Fixed Source #

Cast to `Fixed`, 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, move, notify, notifyByPspec, observeChildren, observeControllers, pick, put, queueAllocate, queueDraw, queueResize, realize, ref, refSink, remove, 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, getChildPosition, getChildTransform, 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, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

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

## getChildPosition

fixedGetChildPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) |
=> a | `fixed`: a `GtkFixed`
-> b | `widget`: a child of `fixed`
-> m (Double, Double) |

Retrieves the translation transformation of the given child `GtkWidget` in the `GtkFixed`.

See also: `fixedGetChildTransform`.

## getChildTransform

fixedGetChildTransform Source #

Arguments

:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) |
=> a | `fixed`: a `GtkFixed`
-> b | `widget`: a `GtkWidget`, child of `fixed`
-> m (Maybe Transform) | Returns: a `GskTransform`

Retrieves the transformation for `widget` set using `fixedSetChildTransform`.

## move

fixedMove Source #

Arguments

:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) |
=> a | `fixed`: a `GtkFixed`
-> b | `widget`: the child widget
-> Double | `x`: the horizontal position to move the widget to
-> Double | `y`: the vertical position to move the widget to
-> m () |

Sets a translation transformation to the given `x` and `y` coordinates to the child `widget` of the `GtkFixed`.

## new

fixedNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Fixed | Returns: a new `GtkFixed`.

Creates a new `GtkFixed`.

## put

fixedPut Source #

Arguments

:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) |
=> a | `fixed`: a `GtkFixed`
-> b | `widget`: the widget to add
-> Double | `x`: the horizontal position to place the widget at
-> Double | `y`: the vertical position to place the widget at
-> m () |

Adds a widget to a `GtkFixed` at the given position.

## remove

fixedRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) |
=> a | `fixed`: a `GtkFixed`
-> b | `widget`: the child widget to remove
-> m () |

Removes a child from `fixed`.

## setChildTransform

fixedSetChildTransform Source #

Arguments

:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) |
=> a | `fixed`: a `GtkFixed`
-> b | `widget`: a `GtkWidget`, child of `fixed`
-> Maybe Transform | `transform`: the transformation assigned to `widget` to reset `widget`'s transform
-> m () |

Sets the transformation for `widget`.

This is a convenience function that retrieves the `FixedLayoutChild` instance associated to `widget` and calls `fixedLayoutChildSetTransform`.