gi-gtk-3.0.37: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.Box

Description

The GtkBox widget arranges child widgets into a single row or column, depending upon the value of its Orientable:orientation property. Within the other dimension, all children are allocated the same size. Of course, the Widget:halign and Widget:valign properties can be used on the children to influence their allocation.

GtkBox uses a notion of packing. Packing refers to adding widgets with reference to a particular position in a Container. For a GtkBox, there are two reference positions: the start and the end of the box. For a vertical Box, the start is defined as the top of the box and the end is defined as the bottom. For a horizontal Box the start is defined as the left side and the end is defined as the right side.

Use repeated calls to boxPackStart to pack widgets into a GtkBox from start to end. Use boxPackEnd to add widgets from end to start. You may intersperse these calls and add widgets from both ends of the same GtkBox.

Because GtkBox is a Container, you may also use containerAdd to insert widgets into the box, and they will be packed with the default values for expand and fill child properties. Use containerRemove to remove widgets from the GtkBox.

Use boxSetHomogeneous to specify whether or not all children of the GtkBox are forced to get the same amount of space.

Use boxSetSpacing to determine how much space will be minimally placed between all children in the GtkBox. Note that spacing is added between the children, while padding added by boxPackStart or boxPackEnd is added on either side of the widget it belongs to.

Use boxReorderChild to move a GtkBox child to a different place in the box.

Use boxSetChildPacking to reset the expand, fill and padding child properties. Use boxQueryChildPacking to query these fields.

CSS nodes

GtkBox uses a single CSS node with name box.

In horizontal orientation, the nodes of the children are always arranged from left to right. So :first-child will always select the leftmost child, regardless of text direction.

Synopsis

Exported types

newtype Box Source #

Memory-managed wrapper type.

Constructors

Box (ManagedPtr Box) 

Instances

Instances details
Eq Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

Methods

(==) :: Box -> Box -> Bool #

(/=) :: Box -> Box -> Bool #

GObject Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

ManagedPtrNewtype Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

Methods

toManagedPtr :: Box -> ManagedPtr Box

TypedObject Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

Methods

glibType :: IO GType

HasParentTypes Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsGValue (Maybe Box) Source #

Convert Box to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Box

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Box -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Box)

type ParentTypes Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

type ParentTypes Box = '[Container, Widget, Object, ImplementorIface, Buildable, Orientable]

class (GObject o, IsDescendantOf Box o) => IsBox o Source #

Type class for types which can be safely cast to Box, for instance with toBox.

Instances

Instances details
(GObject o, IsDescendantOf Box o) => IsBox o Source # 
Instance details

Defined in GI.Gtk.Objects.Box

toBox :: (MonadIO m, IsBox o) => o -> m Box Source #

Cast to Box, 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

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, packEnd, packStart, parserFinished, path, propagateDraw, queryChildPacking, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reorderChild, 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, getBaselinePosition, getBorderWidth, getCanDefault, getCanFocus, getCenterWidget, 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, getHomogeneous, 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, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getSpacing, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.

Setters

setAccelPath, setAllocation, setAppPaintable, setBaselinePosition, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setCenterWidget, setChildPacking, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setHomogeneous, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setSpacing, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.

getBaselinePosition

boxGetBaselinePosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a) 
=> a

box: a Box

-> m BaselinePosition

Returns: the baseline position

Gets the value set by boxSetBaselinePosition.

Since: 3.10

getCenterWidget

boxGetCenterWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a) 
=> a

box: a Box

-> m (Maybe Widget)

Returns: the center widget or Nothing in case no center widget is set.

Retrieves the center widget of the box.

Since: 3.12

getHomogeneous

boxGetHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a) 
=> a

box: a Box

-> m Bool

Returns: True if the box is homogeneous.

Returns whether the box is homogeneous (all children are the same size). See boxSetHomogeneous.

getSpacing

boxGetSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a) 
=> a

box: a Box

-> m Int32

Returns: spacing between children

Gets the value set by boxSetSpacing.

new

boxNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Orientation

orientation: the box’s orientation.

-> Int32

spacing: the number of pixels to place by default between children.

-> m Box

Returns: a new Box.

Creates a new Box.

Since: 3.0

packEnd

boxPackEnd Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a, IsWidget b) 
=> a

box: a Box

-> b

child: the Widget to be added to box

-> Bool

expand: True if the new child is to be given extra space allocated to box. The extra space will be divided evenly between all children of box that use this option

-> Bool

fill: True if space given to child by the expand option is actually allocated to child, rather than just padding it. This parameter has no effect if expand is set to False. A child is always allocated the full height of a horizontal Box and the full width of a vertical Box. This option affects the other dimension

-> Word32

padding: extra space in pixels to put between this child and its neighbors, over and above the global amount specified by Box:spacing property. If child is a widget at one of the reference ends of box, then padding pixels are also put between child and the reference edge of box

-> m () 

Adds child to box, packed with reference to the end of box. The child is packed after (away from end of) any other child packed with reference to the end of box.

packStart

boxPackStart Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a, IsWidget b) 
=> a

box: a Box

-> b

child: the Widget to be added to box

-> Bool

expand: True if the new child is to be given extra space allocated to box. The extra space will be divided evenly between all children that use this option

-> Bool

fill: True if space given to child by the expand option is actually allocated to child, rather than just padding it. This parameter has no effect if expand is set to False. A child is always allocated the full height of a horizontal Box and the full width of a vertical Box. This option affects the other dimension

-> Word32

padding: extra space in pixels to put between this child and its neighbors, over and above the global amount specified by Box:spacing property. If child is a widget at one of the reference ends of box, then padding pixels are also put between child and the reference edge of box

-> m () 

Adds child to box, packed with reference to the start of box. The child is packed after any other child packed with reference to the start of box.

queryChildPacking

boxQueryChildPacking Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a, IsWidget b) 
=> a

box: a Box

-> b

child: the Widget of the child to query

-> m (Bool, Bool, Word32, PackType) 

Obtains information about how child is packed into box.

reorderChild

boxReorderChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a, IsWidget b) 
=> a

box: a Box

-> b

child: the Widget to move

-> Int32

position: the new position for child in the list of children of box, starting from 0. If negative, indicates the end of the list

-> m () 

Moves child to a new position in the list of box children. The list contains widgets packed GTK_PACK_START as well as widgets packed GTK_PACK_END, in the order that these widgets were added to box.

A widget’s position in the box children list determines where the widget is packed into box. A child widget at some position in the list will be packed just after all other widgets of the same packing type that appear earlier in the list.

setBaselinePosition

boxSetBaselinePosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a) 
=> a

box: a Box

-> BaselinePosition

position: a BaselinePosition

-> m () 

Sets the baseline position of a box. This affects only horizontal boxes with at least one baseline aligned child. If there is more vertical space available than requested, and the baseline is not allocated by the parent then position is used to allocate the baseline wrt the extra space available.

Since: 3.10

setCenterWidget

boxSetCenterWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a, IsWidget b) 
=> a

box: a Box

-> Maybe b

widget: the widget to center

-> m () 

Sets a center widget; that is a child widget that will be centered with respect to the full width of the box, even if the children at either side take up different amounts of space.

Since: 3.12

setChildPacking

boxSetChildPacking Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a, IsWidget b) 
=> a

box: a Box

-> b

child: the Widget of the child to set

-> Bool

expand: the new value of the expand child property

-> Bool

fill: the new value of the fill child property

-> Word32

padding: the new value of the padding child property

-> PackType

packType: the new value of the pack-type child property

-> m () 

Sets the way child is packed into box.

setHomogeneous

boxSetHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a) 
=> a

box: a Box

-> Bool

homogeneous: a boolean value, True to create equal allotments, False for variable allotments

-> m () 

Sets the Box:homogeneous property of box, controlling whether or not all children of box are given equal space in the box.

setSpacing

boxSetSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsBox a) 
=> a

box: a Box

-> Int32

spacing: the number of pixels to put between children

-> m () 

Sets the Box:spacing property of box, which is the number of pixels to place between children of box.

Properties

baselinePosition

No description available in the introspection data.

constructBoxBaselinePosition :: (IsBox o, MonadIO m) => BaselinePosition -> m (GValueConstruct o) Source #

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

getBoxBaselinePosition :: (MonadIO m, IsBox o) => o -> m BaselinePosition Source #

Get the value of the “baseline-position” property. When overloading is enabled, this is equivalent to

get box #baselinePosition

setBoxBaselinePosition :: (MonadIO m, IsBox o) => o -> BaselinePosition -> m () Source #

Set the value of the “baseline-position” property. When overloading is enabled, this is equivalent to

set box [ #baselinePosition := value ]

homogeneous

No description available in the introspection data.

constructBoxHomogeneous :: (IsBox o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getBoxHomogeneous :: (MonadIO m, IsBox o) => o -> m Bool Source #

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

get box #homogeneous

setBoxHomogeneous :: (MonadIO m, IsBox o) => o -> Bool -> m () Source #

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

set box [ #homogeneous := value ]

spacing

No description available in the introspection data.

constructBoxSpacing :: (IsBox o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getBoxSpacing :: (MonadIO m, IsBox o) => o -> m Int32 Source #

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

get box #spacing

setBoxSpacing :: (MonadIO m, IsBox o) => o -> Int32 -> m () Source #

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

set box [ #spacing := value ]