gi-gtk-3.0.24: 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 #

Memory-managed wrapper type.

Constructors

Box (ManagedPtr Box) 
Instances
GObject Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

Methods

gobjectType :: Box -> IO GType #

IsImplementorIface Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsObject Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsBuildable Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsOrientable Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsBox Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsContainer Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsWidget Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

class GObject o => IsBox o Source #

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

Instances
(GObject a, (UnknownAncestorError Box a :: Constraint)) => IsBox a Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsBox Box Source # 
Instance details

Defined in GI.Gtk.Objects.Box

IsBox ButtonBox Source # 
Instance details

Defined in GI.Gtk.Objects.ButtonBox

IsBox VButtonBox Source # 
Instance details

Defined in GI.Gtk.Objects.VButtonBox

IsBox VBox Source # 
Instance details

Defined in GI.Gtk.Objects.VBox

IsBox Statusbar Source # 
Instance details

Defined in GI.Gtk.Objects.Statusbar

IsBox StackSwitcher Source # 
Instance details

Defined in GI.Gtk.Objects.StackSwitcher

IsBox ShortcutsShortcut Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutsShortcut

IsBox ShortcutsSection Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutsSection

IsBox ShortcutsGroup Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutsGroup

IsBox ShortcutLabel Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutLabel

IsBox RecentChooserWidget Source # 
Instance details

Defined in GI.Gtk.Objects.RecentChooserWidget

IsBox InfoBar Source # 
Instance details

Defined in GI.Gtk.Objects.InfoBar

IsBox HButtonBox Source # 
Instance details

Defined in GI.Gtk.Objects.HButtonBox

IsBox HBox Source # 
Instance details

Defined in GI.Gtk.Objects.HBox

IsBox FontSelection Source # 
Instance details

Defined in GI.Gtk.Objects.FontSelection

IsBox FontChooserWidget Source # 
Instance details

Defined in GI.Gtk.Objects.FontChooserWidget

IsBox FileChooserWidget Source # 
Instance details

Defined in GI.Gtk.Objects.FileChooserWidget

IsBox FileChooserButton Source # 
Instance details

Defined in GI.Gtk.Objects.FileChooserButton

IsBox ColorSelection Source # 
Instance details

Defined in GI.Gtk.Objects.ColorSelection

IsBox ColorChooserWidget Source # 
Instance details

Defined in GI.Gtk.Objects.ColorChooserWidget

IsBox AppChooserWidget Source # 
Instance details

Defined in GI.Gtk.Objects.AppChooserWidget

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.

noBox :: Maybe Box Source #

A convenience alias for Nothing :: Maybe Box.

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

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 => BaselinePosition -> IO (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 => Bool -> IO (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 => Int32 -> IO (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 ]