Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
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
- newtype Alignment = Alignment (ManagedPtr Alignment)
- class (GObject o, IsDescendantOf Alignment o) => IsAlignment o
- toAlignment :: (MonadIO m, IsAlignment o) => o -> m Alignment
- noAlignment :: Maybe Alignment
- alignmentGetPadding :: (HasCallStack, MonadIO m, IsAlignment a) => a -> m (Word32, Word32, Word32, Word32)
- alignmentNew :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m Alignment
- alignmentSet :: (HasCallStack, MonadIO m, IsAlignment a) => a -> Float -> Float -> Float -> Float -> m ()
- alignmentSetPadding :: (HasCallStack, MonadIO m, IsAlignment a) => a -> Word32 -> Word32 -> Word32 -> Word32 -> m ()
- constructAlignmentBottomPadding :: IsAlignment o => Word32 -> IO (GValueConstruct o)
- getAlignmentBottomPadding :: (MonadIO m, IsAlignment o) => o -> m Word32
- setAlignmentBottomPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m ()
- constructAlignmentLeftPadding :: IsAlignment o => Word32 -> IO (GValueConstruct o)
- getAlignmentLeftPadding :: (MonadIO m, IsAlignment o) => o -> m Word32
- setAlignmentLeftPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m ()
- constructAlignmentRightPadding :: IsAlignment o => Word32 -> IO (GValueConstruct o)
- getAlignmentRightPadding :: (MonadIO m, IsAlignment o) => o -> m Word32
- setAlignmentRightPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m ()
- constructAlignmentTopPadding :: IsAlignment o => Word32 -> IO (GValueConstruct o)
- getAlignmentTopPadding :: (MonadIO m, IsAlignment o) => o -> m Word32
- setAlignmentTopPadding :: (MonadIO m, IsAlignment o) => o -> Word32 -> m ()
- constructAlignmentXalign :: IsAlignment o => Float -> IO (GValueConstruct o)
- getAlignmentXalign :: (MonadIO m, IsAlignment o) => o -> m Float
- setAlignmentXalign :: (MonadIO m, IsAlignment o) => o -> Float -> m ()
- constructAlignmentXscale :: IsAlignment o => Float -> IO (GValueConstruct o)
- getAlignmentXscale :: (MonadIO m, IsAlignment o) => o -> m Float
- setAlignmentXscale :: (MonadIO m, IsAlignment o) => o -> Float -> m ()
- constructAlignmentYalign :: IsAlignment o => Float -> IO (GValueConstruct o)
- getAlignmentYalign :: (MonadIO m, IsAlignment o) => o -> m Float
- setAlignmentYalign :: (MonadIO m, IsAlignment o) => o -> Float -> m ()
- constructAlignmentYscale :: IsAlignment o => Float -> IO (GValueConstruct o)
- getAlignmentYscale :: (MonadIO m, IsAlignment o) => o -> m Float
- setAlignmentYscale :: (MonadIO m, IsAlignment o) => o -> Float -> m ()
Exported types
Memory-managed wrapper type.
Instances
GObject Alignment Source # | |
Defined in GI.Gtk.Objects.Alignment gobjectType :: IO GType # | |
HasParentTypes Alignment Source # | |
Defined in GI.Gtk.Objects.Alignment | |
type ParentTypes Alignment Source # | |
Defined in GI.Gtk.Objects.Alignment type ParentTypes Alignment = Bin ': (Container ': (Widget ': (Object ': (ImplementorIface ': (Buildable ': ([] :: [Type])))))) |
class (GObject o, IsDescendantOf Alignment o) => IsAlignment o Source #
Type class for types which can be safely cast to Alignment
, for instance with toAlignment
.
Instances
(GObject o, IsDescendantOf Alignment o) => IsAlignment o Source # | |
Defined in GI.Gtk.Objects.Alignment |
toAlignment :: (MonadIO m, IsAlignment o) => o -> m Alignment Source #
Methods
getPadding
:: (HasCallStack, MonadIO m, IsAlignment a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m Alignment | Returns: the new |
set
:: (HasCallStack, MonadIO m, IsAlignment a) | |
=> a |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
setPadding
:: (HasCallStack, MonadIO m, IsAlignment a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> 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 ]