gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Box

Contents

Description

The GtkBox widget organizes child widgets into a rectangular area.

The rectangular area of a GtkBox is organized into either a single row or a single column of child widgets depending upon the orientation. Thus, all children of a GtkBox are allocated one dimension in common, which is the height of a row, or the width of a column.

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.

Note that a single-row or single-column Grid provides exactly the same functionality as Box.

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 #

Constructors

Box (ManagedPtr Box) 

Instances

GObject Box Source # 

Methods

gobjectType :: Box -> IO GType #

IsImplementorIface Box Source # 
IsObject Box Source # 
IsWidget Box Source # 
IsContainer Box Source # 
IsBox Box Source # 
IsOrientable Box Source # 
IsBuildable Box Source # 
((~) * info (ResolveBoxMethod t Box), MethodInfo * info Box p) => IsLabel t (Box -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> Box -> p #

((~) * info (ResolveBoxMethod t Box), MethodInfo * info Box p) => IsLabelProxy t (Box -> p) Source # 

Methods

fromLabelProxy :: Proxy Symbol t -> Box -> p #

HasAttributeList * Box Source # 
type AttributeList Box Source # 
type SignalList Box Source # 

toBox :: IsBox o => o -> IO Box Source #

Methods

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

data BoxGetHomogeneousMethodInfo Source #

Instances

((~) * signature (m Bool), MonadIO m, IsBox a) => MethodInfo * BoxGetHomogeneousMethodInfo a signature Source # 

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

data BoxGetSpacingMethodInfo Source #

Instances

((~) * signature (m Int32), MonadIO m, IsBox a) => MethodInfo * BoxGetSpacingMethodInfo a signature Source # 

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

data BoxPackEndMethodInfo Source #

Instances

((~) * signature (b -> Bool -> Bool -> Word32 -> m ()), MonadIO m, IsBox a, IsWidget b) => MethodInfo * BoxPackEndMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy BoxPackEndMethodInfo a -> signature -> s #

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

data BoxPackStartMethodInfo Source #

Instances

((~) * signature (b -> Bool -> Bool -> Word32 -> m ()), MonadIO m, IsBox a, IsWidget b) => MethodInfo * BoxPackStartMethodInfo a signature Source # 

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

data BoxReorderChildMethodInfo Source #

Instances

((~) * signature (b -> Int32 -> m ()), MonadIO m, IsBox a, IsWidget b) => MethodInfo * BoxReorderChildMethodInfo a signature Source # 

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

data BoxSetCenterWidgetMethodInfo Source #

Instances

((~) * signature (Maybe b -> m ()), MonadIO m, IsBox a, IsWidget b) => MethodInfo * BoxSetCenterWidgetMethodInfo a signature Source # 

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

data BoxSetChildPackingMethodInfo Source #

Instances

((~) * signature (b -> Bool -> Bool -> Word32 -> PackType -> m ()), MonadIO m, IsBox a, IsWidget b) => MethodInfo * BoxSetChildPackingMethodInfo a signature Source # 

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

data BoxSetHomogeneousMethodInfo Source #

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsBox a) => MethodInfo * BoxSetHomogeneousMethodInfo a signature Source # 

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

data BoxSetSpacingMethodInfo Source #

Instances

((~) * signature (Int32 -> m ()), MonadIO m, IsBox a) => MethodInfo * BoxSetSpacingMethodInfo a signature Source # 

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

data BoxBaselinePositionPropertyInfo Source #

Instances

AttrInfo BoxBaselinePositionPropertyInfo Source # 
type AttrOrigin BoxBaselinePositionPropertyInfo Source # 
type AttrLabel BoxBaselinePositionPropertyInfo Source # 
type AttrLabel BoxBaselinePositionPropertyInfo = "baseline-position"
type AttrGetType BoxBaselinePositionPropertyInfo Source # 
type AttrBaseTypeConstraint BoxBaselinePositionPropertyInfo Source # 
type AttrSetTypeConstraint BoxBaselinePositionPropertyInfo Source # 
type AttrAllowedOps BoxBaselinePositionPropertyInfo Source # 

homogeneous

data BoxHomogeneousPropertyInfo Source #

Instances

AttrInfo BoxHomogeneousPropertyInfo Source # 
type AttrOrigin BoxHomogeneousPropertyInfo Source # 
type AttrLabel BoxHomogeneousPropertyInfo Source # 
type AttrGetType BoxHomogeneousPropertyInfo Source # 
type AttrBaseTypeConstraint BoxHomogeneousPropertyInfo Source # 
type AttrSetTypeConstraint BoxHomogeneousPropertyInfo Source # 
type AttrAllowedOps BoxHomogeneousPropertyInfo Source # 

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

spacing

data BoxSpacingPropertyInfo Source #

Instances

AttrInfo BoxSpacingPropertyInfo Source # 
type AttrOrigin BoxSpacingPropertyInfo Source # 
type AttrLabel BoxSpacingPropertyInfo Source # 
type AttrGetType BoxSpacingPropertyInfo Source # 
type AttrBaseTypeConstraint BoxSpacingPropertyInfo Source # 
type AttrSetTypeConstraint BoxSpacingPropertyInfo Source # 
type AttrAllowedOps BoxSpacingPropertyInfo Source # 

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

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