Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GtkFixed
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
Memory-managed wrapper type.
Instances
Eq Fixed Source # | |
GObject Fixed Source # | |
Defined in GI.Gtk.Objects.Fixed | |
ManagedPtrNewtype Fixed Source # | |
Defined in GI.Gtk.Objects.Fixed toManagedPtr :: Fixed -> ManagedPtr Fixed | |
TypedObject Fixed Source # | |
Defined in GI.Gtk.Objects.Fixed | |
HasParentTypes Fixed Source # | |
Defined in GI.Gtk.Objects.Fixed | |
IsGValue (Maybe Fixed) Source # | Convert |
Defined in GI.Gtk.Objects.Fixed gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Fixed -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Fixed) | |
type ParentTypes Fixed Source # | |
Defined in GI.Gtk.Objects.Fixed |
class (GObject o, IsDescendantOf Fixed o) => IsFixed o Source #
Instances
(GObject o, IsDescendantOf Fixed o) => IsFixed o Source # | |
Defined in GI.Gtk.Objects.Fixed |
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, 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, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChildPosition, getChildTransform, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, 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
setCanFocus, setCanTarget, setChildTransform, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.
getChildPosition
fixedGetChildPosition Source #
:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) | |
=> a |
|
-> b |
|
-> m (Double, Double) |
Retrieves the translation transformation of the
given child GtkWidget
in the GtkFixed
.
See also: fixedGetChildTransform
.
getChildTransform
fixedGetChildTransform Source #
:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) | |
=> a |
|
-> b |
|
-> m (Maybe Transform) | Returns: a |
Retrieves the transformation for widget
set using
fixedSetChildTransform
.
move
:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) | |
=> a |
|
-> b |
|
-> Double |
|
-> Double |
|
-> m () |
Sets a translation transformation to the given x
and y
coordinates to the child widget
of the GtkFixed
.
new
:: (HasCallStack, MonadIO m) | |
=> m Fixed | Returns: a new |
Creates a new GtkFixed
.
put
:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) | |
=> a |
|
-> b |
|
-> Double |
|
-> Double |
|
-> m () |
Adds a widget to a GtkFixed
at the given position.
remove
:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Removes a child from fixed
.
setChildTransform
fixedSetChildTransform Source #
:: (HasCallStack, MonadIO m, IsFixed a, IsWidget b) | |
=> a |
|
-> b |
|
-> Maybe Transform |
|
-> m () |
Sets the transformation for widget
.
This is a convenience function that retrieves the
FixedLayoutChild
instance associated to
widget
and calls fixedLayoutChildSetTransform
.