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 |
- Exported types
- Methods
- attach
- attachNextTo
- getBaselineRow
- getChildAt
- getColumnHomogeneous
- getColumnSpacing
- getRowBaselinePosition
- getRowHomogeneous
- getRowSpacing
- insertColumn
- insertNextTo
- insertRow
- new
- removeColumn
- removeRow
- setBaselineRow
- setColumnHomogeneous
- setColumnSpacing
- setRowBaselinePosition
- setRowHomogeneous
- setRowSpacing
- Properties
GtkGrid is a container which arranges its child widgets in rows and columns, with arbitrary positions and horizontal/vertical spans.
Children are added using gridAttach
. They can span multiple
rows or columns. It is also possible to add a child next to an
existing child, using gridAttachNextTo
. The behaviour of
GtkGrid when several children occupy the same grid cell is undefined.
GtkGrid can be used like a Box
by just using containerAdd
,
which will place children next to each other in the direction determined
by the Orientable
:orientation
property. However, if all you want is a
single row or column, then Box
is the preferred widget.
CSS nodes
GtkGrid uses a single CSS node with name grid.
Synopsis
- newtype Grid = Grid (ManagedPtr Grid)
- class (GObject o, IsDescendantOf Grid o) => IsGrid o
- toGrid :: (MonadIO m, IsGrid o) => o -> m Grid
- gridAttach :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) => a -> b -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- gridAttachNextTo :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b, IsWidget c) => a -> b -> Maybe c -> PositionType -> Int32 -> Int32 -> m ()
- gridGetBaselineRow :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Int32
- gridGetChildAt :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> Int32 -> m (Maybe Widget)
- gridGetColumnHomogeneous :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Bool
- gridGetColumnSpacing :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Word32
- gridGetRowBaselinePosition :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m BaselinePosition
- gridGetRowHomogeneous :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Bool
- gridGetRowSpacing :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Word32
- gridInsertColumn :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- gridInsertNextTo :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) => a -> b -> PositionType -> m ()
- gridInsertRow :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- gridNew :: (HasCallStack, MonadIO m) => m Grid
- gridRemoveColumn :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- gridRemoveRow :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- gridSetBaselineRow :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- gridSetColumnHomogeneous :: (HasCallStack, MonadIO m, IsGrid a) => a -> Bool -> m ()
- gridSetColumnSpacing :: (HasCallStack, MonadIO m, IsGrid a) => a -> Word32 -> m ()
- gridSetRowBaselinePosition :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> BaselinePosition -> m ()
- gridSetRowHomogeneous :: (HasCallStack, MonadIO m, IsGrid a) => a -> Bool -> m ()
- gridSetRowSpacing :: (HasCallStack, MonadIO m, IsGrid a) => a -> Word32 -> m ()
- constructGridBaselineRow :: (IsGrid o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getGridBaselineRow :: (MonadIO m, IsGrid o) => o -> m Int32
- setGridBaselineRow :: (MonadIO m, IsGrid o) => o -> Int32 -> m ()
- constructGridColumnHomogeneous :: (IsGrid o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGridColumnHomogeneous :: (MonadIO m, IsGrid o) => o -> m Bool
- setGridColumnHomogeneous :: (MonadIO m, IsGrid o) => o -> Bool -> m ()
- constructGridColumnSpacing :: (IsGrid o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getGridColumnSpacing :: (MonadIO m, IsGrid o) => o -> m Int32
- setGridColumnSpacing :: (MonadIO m, IsGrid o) => o -> Int32 -> m ()
- constructGridRowHomogeneous :: (IsGrid o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGridRowHomogeneous :: (MonadIO m, IsGrid o) => o -> m Bool
- setGridRowHomogeneous :: (MonadIO m, IsGrid o) => o -> Bool -> m ()
- constructGridRowSpacing :: (IsGrid o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getGridRowSpacing :: (MonadIO m, IsGrid o) => o -> m Int32
- setGridRowSpacing :: (MonadIO m, IsGrid o) => o -> Int32 -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Grid Source # | |
GObject Grid Source # | |
Defined in GI.Gtk.Objects.Grid | |
ManagedPtrNewtype Grid Source # | |
Defined in GI.Gtk.Objects.Grid toManagedPtr :: Grid -> ManagedPtr Grid | |
TypedObject Grid Source # | |
Defined in GI.Gtk.Objects.Grid | |
HasParentTypes Grid Source # | |
Defined in GI.Gtk.Objects.Grid | |
IsGValue (Maybe Grid) Source # | Convert |
Defined in GI.Gtk.Objects.Grid gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Grid -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Grid) | |
type ParentTypes Grid Source # | |
Defined in GI.Gtk.Objects.Grid |
class (GObject o, IsDescendantOf Grid o) => IsGrid o Source #
Instances
(GObject o, IsDescendantOf Grid o) => IsGrid o Source # | |
Defined in GI.Gtk.Objects.Grid |
Methods
Click to display all available methods, including inherited ones
Methods
activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, attach, attachNextTo, 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, insertColumn, insertNextTo, insertRow, 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, removeColumn, removeMnemonicLabel, removeRow, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, 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, getBaselineRow, getBorderWidth, getCanDefault, getCanFocus, getChildAt, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getColumnHomogeneous, getColumnSpacing, 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, getOrientation, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getRowBaselinePosition, getRowHomogeneous, getRowSpacing, 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, setBaselineRow, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setColumnHomogeneous, setColumnSpacing, 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, setOrientation, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setRowBaselinePosition, setRowHomogeneous, setRowSpacing, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.
attach
:: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Adds a widget to the grid.
The position of child
is determined by left
and top
. The
number of “cells” that child
will occupy is determined by
width
and height
.
attachNextTo
:: (HasCallStack, MonadIO m, IsGrid a, IsWidget b, IsWidget c) | |
=> a |
|
-> b |
|
-> Maybe c |
|
-> PositionType |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Adds a widget to the grid.
The widget is placed next to sibling
, on the side determined by
side
. When sibling
is Nothing
, the widget is placed in row (for
left or right placement) or column 0 (for top or bottom placement),
at the end indicated by side
.
Attaching widgets labeled [1], [2], [3] with sibling
== Nothing
and
side
== PositionTypeLeft
yields a layout of [3][2][1].
getBaselineRow
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Int32 | Returns: the row index defining the global baseline |
Returns which row defines the global baseline of grid
.
Since: 3.10
getChildAt
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m (Maybe Widget) | Returns: the child at the given position, or |
Gets the child of grid
whose area covers the grid
cell whose upper left corner is at left
, top
.
Since: 3.2
getColumnHomogeneous
gridGetColumnHomogeneous Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Bool | Returns: whether all columns of |
Returns whether all columns of grid
have the same width.
getColumnSpacing
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Word32 | Returns: the column spacing of |
Returns the amount of space between the columns of grid
.
getRowBaselinePosition
gridGetRowBaselinePosition Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> m BaselinePosition | Returns: the baseline position of |
Returns the baseline position of row
as set
by gridSetRowBaselinePosition
or the default value
BaselinePositionCenter
.
Since: 3.10
getRowHomogeneous
gridGetRowHomogeneous Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Bool | Returns: whether all rows of |
Returns whether all rows of grid
have the same height.
getRowSpacing
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Word32 | Returns: the row spacing of |
Returns the amount of space between the rows of grid
.
insertColumn
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> m () |
Inserts a column at the specified position.
Children which are attached at or to the right of this position are moved one column to the right. Children which span across this position are grown to span the new column.
Since: 3.2
insertNextTo
:: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) | |
=> a |
|
-> b |
|
-> PositionType |
|
-> m () |
Inserts a row or column at the specified position.
The new row or column is placed next to sibling
, on the side
determined by side
. If side
is PositionTypeTop
or PositionTypeBottom
,
a row is inserted. If side
is PositionTypeLeft
of PositionTypeRight
,
a column is inserted.
Since: 3.2
insertRow
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> m () |
Inserts a row at the specified position.
Children which are attached at or below this position are moved one row down. Children which span across this position are grown to span the new row.
Since: 3.2
new
:: (HasCallStack, MonadIO m) | |
=> m Grid | Returns: the new |
Creates a new grid widget.
removeColumn
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> m () |
Removes a column from the grid.
Children that are placed in this column are removed, spanning children that overlap this column have their width reduced by one, and children after the column are moved to the left.
Since: 3.10
removeRow
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> m () |
Removes a row from the grid.
Children that are placed in this row are removed, spanning children that overlap this row have their height reduced by one, and children below the row are moved up.
Since: 3.10
setBaselineRow
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets which row defines the global baseline for the entire grid.
Each row in the grid can have its own local baseline, but only
one of those is global, meaning it will be the baseline in the
parent of the grid
.
Since: 3.10
setColumnHomogeneous
gridSetColumnHomogeneous Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether all columns of grid
will have the same width.
setColumnSpacing
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the amount of space between columns of grid
.
setRowBaselinePosition
gridSetRowBaselinePosition Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> BaselinePosition |
|
-> m () |
Sets how the baseline should be positioned on row
of the
grid, in case that row is assigned more space than is requested.
Since: 3.10
setRowHomogeneous
gridSetRowHomogeneous Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether all rows of grid
will have the same height.
setRowSpacing
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the amount of space between rows of grid
.
Properties
baselineRow
No description available in the introspection data.
constructGridBaselineRow :: (IsGrid o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “baseline-row
” property. This is rarely needed directly, but it is used by new
.
getGridBaselineRow :: (MonadIO m, IsGrid o) => o -> m Int32 Source #
Get the value of the “baseline-row
” property.
When overloading is enabled, this is equivalent to
get
grid #baselineRow
setGridBaselineRow :: (MonadIO m, IsGrid o) => o -> Int32 -> m () Source #
Set the value of the “baseline-row
” property.
When overloading is enabled, this is equivalent to
set
grid [ #baselineRow:=
value ]
columnHomogeneous
No description available in the introspection data.
constructGridColumnHomogeneous :: (IsGrid o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “column-homogeneous
” property. This is rarely needed directly, but it is used by new
.
getGridColumnHomogeneous :: (MonadIO m, IsGrid o) => o -> m Bool Source #
Get the value of the “column-homogeneous
” property.
When overloading is enabled, this is equivalent to
get
grid #columnHomogeneous
setGridColumnHomogeneous :: (MonadIO m, IsGrid o) => o -> Bool -> m () Source #
Set the value of the “column-homogeneous
” property.
When overloading is enabled, this is equivalent to
set
grid [ #columnHomogeneous:=
value ]
columnSpacing
No description available in the introspection data.
constructGridColumnSpacing :: (IsGrid o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “column-spacing
” property. This is rarely needed directly, but it is used by new
.
getGridColumnSpacing :: (MonadIO m, IsGrid o) => o -> m Int32 Source #
Get the value of the “column-spacing
” property.
When overloading is enabled, this is equivalent to
get
grid #columnSpacing
setGridColumnSpacing :: (MonadIO m, IsGrid o) => o -> Int32 -> m () Source #
Set the value of the “column-spacing
” property.
When overloading is enabled, this is equivalent to
set
grid [ #columnSpacing:=
value ]
rowHomogeneous
No description available in the introspection data.
constructGridRowHomogeneous :: (IsGrid o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “row-homogeneous
” property. This is rarely needed directly, but it is used by new
.
getGridRowHomogeneous :: (MonadIO m, IsGrid o) => o -> m Bool Source #
Get the value of the “row-homogeneous
” property.
When overloading is enabled, this is equivalent to
get
grid #rowHomogeneous
setGridRowHomogeneous :: (MonadIO m, IsGrid o) => o -> Bool -> m () Source #
Set the value of the “row-homogeneous
” property.
When overloading is enabled, this is equivalent to
set
grid [ #rowHomogeneous:=
value ]
rowSpacing
No description available in the introspection data.
constructGridRowSpacing :: (IsGrid o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “row-spacing
” property. This is rarely needed directly, but it is used by new
.
getGridRowSpacing :: (MonadIO m, IsGrid o) => o -> m Int32 Source #
Get the value of the “row-spacing
” property.
When overloading is enabled, this is equivalent to
get
grid #rowSpacing
setGridRowSpacing :: (MonadIO m, IsGrid o) => o -> Int32 -> m () Source #
Set the value of the “row-spacing
” property.
When overloading is enabled, this is equivalent to
set
grid [ #rowSpacing:=
value ]