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.Alignment

Contents

Description

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

Exported types

newtype Alignment Source #

Memory-managed wrapper type.

Instances
GObject Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

IsImplementorIface Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

IsObject Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

IsBuildable Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

IsBin Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

IsContainer Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

IsWidget Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

IsAlignment Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

class GObject o => IsAlignment o Source #

Type class for types which can be safely cast to Alignment, for instance with toAlignment.

Instances
(GObject a, (UnknownAncestorError Alignment a :: Constraint)) => IsAlignment a Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

IsAlignment Alignment Source # 
Instance details

Defined in GI.Gtk.Objects.Alignment

toAlignment :: (MonadIO m, IsAlignment o) => o -> m Alignment Source #

Cast to Alignment, for types for which this is known to be safe. For general casts, use castTo.

noAlignment :: Maybe Alignment Source #

A convenience alias for Nothing :: Maybe Alignment.

Methods

getPadding

alignmentGetPadding Source #

Arguments

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

alignment: a Alignment

-> 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

alignmentNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

xalign: the horizontal alignment of the child widget, from 0 (left) to 1 (right).

-> Float

yalign: the vertical alignment of the child widget, from 0 (top) to 1 (bottom).

-> Float

xscale: the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the Alignment.

-> Float

yscale: the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.

-> m Alignment

Returns: the new Alignment

Deprecated: (Since version 3.14)Use Widget alignment and margin properties

Creates a new Alignment.

set

alignmentSet Source #

Arguments

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

alignment: a Alignment.

-> Float

xalign: the horizontal alignment of the child widget, from 0 (left) to 1 (right).

-> Float

yalign: the vertical alignment of the child widget, from 0 (top) to 1 (bottom).

-> Float

xscale: the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the Alignment.

-> Float

yscale: the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.

-> m () 

Deprecated: (Since version 3.14)Use Widget alignment and margin properties

Sets the Alignment values.

setPadding

alignmentSetPadding Source #

Arguments

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

alignment: a Alignment

-> Word32

paddingTop: the padding at the top of the widget

-> Word32

paddingBottom: the padding at the bottom of the widget

-> Word32

paddingLeft: the padding at the left of the widget

-> Word32

paddingRight: the padding at the right of the widget.

-> 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 => Word32 -> IO (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 => Word32 -> IO (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 => Word32 -> IO (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 => Word32 -> IO (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 => Float -> IO (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 => Float -> IO (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 => Float -> IO (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 => Float -> IO (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 ]