Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The Alignment
widget controls the alignment and size of its child widget.
It has four settings: xscale, yscale, xalign, and yalign.
The scale settings are used to specify how much the child widget should
expand to fill the space allocated to the Alignment
.
The values can range from 0 (meaning the child doesn’t expand at all) to
1 (meaning the child expands to fill all of the available space).
The align settings are used to place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect.
GtkAlignment has been deprecated in 3.14 and should not be used in
newly-written code. The desired effect can be achieved by using the
Widget
:halign
, Widget
:valign
and Widget
:margin
properties on the
child widget.
Synopsis
- newtype Alignment = Alignment (ManagedPtr Alignment)
- class (GObject o, IsDescendantOf Alignment o) => IsAlignment o
- toAlignment :: (MonadIO m, IsAlignment o) => o -> m Alignment
- alignmentGetPadding :: (HasCallStack, MonadIO m, IsAlignment a) => a -> m (Word32, Word32, Word32, Word32)
- alignmentNew :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m Alignment
- alignmentSet :: (HasCallStack, MonadIO m, IsAlignment a) => a -> Float -> Float -> Float -> Float -> m ()
- alignmentSetPadding :: (HasCallStack, MonadIO m, IsAlignment a) => a -> Word32 -> Word32 -> Word32 -> Word32 -> m ()
- constructAlignmentBottomPadding :: (IsAlignment o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getAlignmentBottomPadding :: (MonadIO m, IsAlignment o) => o -> m Word32
- setAlignmentBottomPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m ()
- constructAlignmentLeftPadding :: (IsAlignment o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getAlignmentLeftPadding :: (MonadIO m, IsAlignment o) => o -> m Word32
- setAlignmentLeftPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m ()
- constructAlignmentRightPadding :: (IsAlignment o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getAlignmentRightPadding :: (MonadIO m, IsAlignment o) => o -> m Word32
- setAlignmentRightPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m ()
- constructAlignmentTopPadding :: (IsAlignment o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getAlignmentTopPadding :: (MonadIO m, IsAlignment o) => o -> m Word32
- setAlignmentTopPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m ()
- constructAlignmentXalign :: (IsAlignment o, MonadIO m) => Float -> m (GValueConstruct o)
- getAlignmentXalign :: (MonadIO m, IsAlignment o) => o -> m Float
- setAlignmentXalign :: (MonadIO m, IsAlignment o) => o -> Float -> m ()
- constructAlignmentXscale :: (IsAlignment o, MonadIO m) => Float -> m (GValueConstruct o)
- getAlignmentXscale :: (MonadIO m, IsAlignment o) => o -> m Float
- setAlignmentXscale :: (MonadIO m, IsAlignment o) => o -> Float -> m ()
- constructAlignmentYalign :: (IsAlignment o, MonadIO m) => Float -> m (GValueConstruct o)
- getAlignmentYalign :: (MonadIO m, IsAlignment o) => o -> m Float
- setAlignmentYalign :: (MonadIO m, IsAlignment o) => o -> Float -> m ()
- constructAlignmentYscale :: (IsAlignment o, MonadIO m) => Float -> m (GValueConstruct o)
- getAlignmentYscale :: (MonadIO m, IsAlignment o) => o -> m Float
- setAlignmentYscale :: (MonadIO m, IsAlignment o) => o -> Float -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Alignment Source # | |
GObject Alignment Source # | |
Defined in GI.Gtk.Objects.Alignment | |
ManagedPtrNewtype Alignment Source # | |
Defined in GI.Gtk.Objects.Alignment toManagedPtr :: Alignment -> ManagedPtr Alignment | |
TypedObject Alignment Source # | |
Defined in GI.Gtk.Objects.Alignment | |
HasParentTypes Alignment Source # | |
Defined in GI.Gtk.Objects.Alignment | |
IsGValue (Maybe Alignment) Source # | Convert |
Defined in GI.Gtk.Objects.Alignment gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Alignment -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Alignment) | |
type ParentTypes Alignment Source # | |
class (GObject o, IsDescendantOf Alignment o) => IsAlignment o Source #
Type class for types which can be safely cast to Alignment
, for instance with toAlignment
.
Instances
(GObject o, IsDescendantOf Alignment o) => IsAlignment o Source # | |
Defined in GI.Gtk.Objects.Alignment |
toAlignment :: (MonadIO m, IsAlignment o) => o -> m Alignment Source #
Methods
Click to display all available methods, including inherited ones
Methods
activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, set, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.
Getters
getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPadding, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.
Setters
setAccelPath, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setPadding, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.
getPadding
:: (HasCallStack, MonadIO m, IsAlignment a) | |
=> a |
|
-> m (Word32, Word32, Word32, Word32) |
Deprecated: (Since version 3.14)Use Widget
alignment and margin properties
Gets the padding on the different sides of the widget. See gtk_alignment_set_padding ().
Since: 2.4
new
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m Alignment | Returns: the new |
set
:: (HasCallStack, MonadIO m, IsAlignment a) | |
=> a |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
setPadding
:: (HasCallStack, MonadIO m, IsAlignment a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.14)Use Widget
alignment and margin properties
Sets the padding on the different sides of the widget. The padding adds blank space to the sides of the widget. For instance, this can be used to indent the child widget towards the right by adding padding on the left.
Since: 2.4
Properties
bottomPadding
The padding to insert at the bottom of the widget.
Since: 2.4
constructAlignmentBottomPadding :: (IsAlignment o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “bottom-padding
” property. This is rarely needed directly, but it is used by new
.
getAlignmentBottomPadding :: (MonadIO m, IsAlignment o) => o -> m Word32 Source #
Get the value of the “bottom-padding
” property.
When overloading is enabled, this is equivalent to
get
alignment #bottomPadding
setAlignmentBottomPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m () Source #
Set the value of the “bottom-padding
” property.
When overloading is enabled, this is equivalent to
set
alignment [ #bottomPadding:=
value ]
leftPadding
The padding to insert at the left of the widget.
Since: 2.4
constructAlignmentLeftPadding :: (IsAlignment o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “left-padding
” property. This is rarely needed directly, but it is used by new
.
getAlignmentLeftPadding :: (MonadIO m, IsAlignment o) => o -> m Word32 Source #
Get the value of the “left-padding
” property.
When overloading is enabled, this is equivalent to
get
alignment #leftPadding
setAlignmentLeftPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m () Source #
Set the value of the “left-padding
” property.
When overloading is enabled, this is equivalent to
set
alignment [ #leftPadding:=
value ]
rightPadding
The padding to insert at the right of the widget.
Since: 2.4
constructAlignmentRightPadding :: (IsAlignment o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “right-padding
” property. This is rarely needed directly, but it is used by new
.
getAlignmentRightPadding :: (MonadIO m, IsAlignment o) => o -> m Word32 Source #
Get the value of the “right-padding
” property.
When overloading is enabled, this is equivalent to
get
alignment #rightPadding
setAlignmentRightPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m () Source #
Set the value of the “right-padding
” property.
When overloading is enabled, this is equivalent to
set
alignment [ #rightPadding:=
value ]
topPadding
The padding to insert at the top of the widget.
Since: 2.4
constructAlignmentTopPadding :: (IsAlignment o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “top-padding
” property. This is rarely needed directly, but it is used by new
.
getAlignmentTopPadding :: (MonadIO m, IsAlignment o) => o -> m Word32 Source #
Get the value of the “top-padding
” property.
When overloading is enabled, this is equivalent to
get
alignment #topPadding
setAlignmentTopPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m () Source #
Set the value of the “top-padding
” property.
When overloading is enabled, this is equivalent to
set
alignment [ #topPadding:=
value ]
xalign
Horizontal position of child in available space. A value of 0.0 will flush the child left (or right, in RTL locales); a value of 1.0 will flush the child right (or left, in RTL locales).
constructAlignmentXalign :: (IsAlignment 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
.
getAlignmentXalign :: (MonadIO m, IsAlignment o) => o -> m Float Source #
Get the value of the “xalign
” property.
When overloading is enabled, this is equivalent to
get
alignment #xalign
setAlignmentXalign :: (MonadIO m, IsAlignment o) => o -> Float -> m () Source #
Set the value of the “xalign
” property.
When overloading is enabled, this is equivalent to
set
alignment [ #xalign:=
value ]
xscale
If available horizontal space is bigger than needed, how much of it to use for the child. A value of 0.0 means none; a value of 1.0 means all.
constructAlignmentXscale :: (IsAlignment o, MonadIO m) => Float -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “xscale
” property. This is rarely needed directly, but it is used by new
.
getAlignmentXscale :: (MonadIO m, IsAlignment o) => o -> m Float Source #
Get the value of the “xscale
” property.
When overloading is enabled, this is equivalent to
get
alignment #xscale
setAlignmentXscale :: (MonadIO m, IsAlignment o) => o -> Float -> m () Source #
Set the value of the “xscale
” property.
When overloading is enabled, this is equivalent to
set
alignment [ #xscale:=
value ]
yalign
Vertical position of child in available space. A value of 0.0 will flush the child to the top; a value of 1.0 will flush the child to the bottom.
constructAlignmentYalign :: (IsAlignment 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
.
getAlignmentYalign :: (MonadIO m, IsAlignment o) => o -> m Float Source #
Get the value of the “yalign
” property.
When overloading is enabled, this is equivalent to
get
alignment #yalign
setAlignmentYalign :: (MonadIO m, IsAlignment o) => o -> Float -> m () Source #
Set the value of the “yalign
” property.
When overloading is enabled, this is equivalent to
set
alignment [ #yalign:=
value ]
yscale
If available vertical space is bigger than needed, how much of it to use for the child. A value of 0.0 means none; a value of 1.0 means all.
constructAlignmentYscale :: (IsAlignment o, MonadIO m) => Float -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “yscale
” property. This is rarely needed directly, but it is used by new
.
getAlignmentYscale :: (MonadIO m, IsAlignment o) => o -> m Float Source #
Get the value of the “yscale
” property.
When overloading is enabled, this is equivalent to
get
alignment #yscale
setAlignmentYscale :: (MonadIO m, IsAlignment o) => o -> Float -> m () Source #
Set the value of the “yscale
” property.
When overloading is enabled, this is equivalent to
set
alignment [ #yscale:=
value ]