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

GI.Gtk.Objects.Frame

Description

The frame widget is a widget that surrounds its child with a decorative frame and an optional label. If present, the label is drawn inside the top edge of the frame. The horizontal position of the label can be controlled with frameSetLabelAlign.

GtkFrame as GtkBuildable

The GtkFrame implementation of the GtkBuildable interface supports placing a child in the label position by specifying “label” as the “type” attribute of a <child> element. A normal content child can be specified without specifying a <child> type attribute.

An example of a UI definition fragment with GtkFrame: > >class="GtkFrame" > type="label" > class="GtkLabel" id="frame_label"/ > /child > child > class="GtkEntry" id="frame_content"/ > /child >/object

CSS nodes

plain code

frame
├── <label widget>
╰── <child>

GtkFrame has a main CSS node with name “frame”, which is used to draw the visible border. You can set the appearance of the border using CSS properties like “border-style” on this node.

Synopsis

Exported types

newtype Frame Source #

Memory-managed wrapper type.

Constructors

Frame (ManagedPtr Frame) 

Instances

Instances details
Eq Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

Methods

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

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

IsGValue Frame Source #

Convert Frame to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Frame

ManagedPtrNewtype Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

TypedObject Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

Methods

glibType :: IO GType #

GObject Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

HasParentTypes Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

type ParentTypes Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

type ParentTypes Frame = '[Widget, Object, ImplementorIface, Buildable, ConstraintTarget]

class (GObject o, IsDescendantOf Frame o) => IsFrame o Source #

Type class for types which can be safely cast to Frame, for instance with toFrame.

Instances

Instances details
(GObject o, IsDescendantOf Frame o) => IsFrame o Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

toFrame :: (MonadIO m, IsFrame o) => o -> m Frame Source #

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

Methods

Overloaded methods

getChild

frameGetChild Source #

Arguments

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

frame: a Frame

-> m (Maybe Widget)

Returns: the child widget of frame

Gets the child widget of frame.

getLabel

frameGetLabel Source #

Arguments

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

frame: a Frame

-> m (Maybe Text)

Returns: the text in the label, or Nothing if there was no label widget or the lable widget was not a Label. This string is owned by GTK+ and must not be modified or freed.

If the frame’s label widget is a Label, returns the text in the label widget. (The frame will have a Label for the label widget if a non-Nothing argument was passed to frameNew.)

getLabelAlign

frameGetLabelAlign Source #

Arguments

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

frame: a Frame

-> m Float 

Retrieves the X alignment of the frame’s label. See frameSetLabelAlign.

getLabelWidget

frameGetLabelWidget Source #

Arguments

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

frame: a Frame

-> m (Maybe Widget)

Returns: the label widget, or Nothing if there is none.

Retrieves the label widget for the frame. See frameSetLabelWidget.

new

frameNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

label: the text to use as the label of the frame

-> m Frame

Returns: a new Frame widget

Creates a new Frame, with optional label label. If label is Nothing, the label is omitted.

setChild

frameSetChild Source #

Arguments

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

frame: a Frame

-> Maybe b

child: the child widget

-> m () 

Sets the child widget of frame.

setLabel

frameSetLabel Source #

Arguments

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

frame: a Frame

-> Maybe Text

label: the text to use as the label of the frame

-> m () 

Removes the current Frame:label-widget. If label is not Nothing, creates a new Label with that text and adds it as the Frame:label-widget.

setLabelAlign

frameSetLabelAlign Source #

Arguments

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

frame: a Frame

-> Float

xalign: The position of the label along the top edge of the widget. A value of 0.0 represents left alignment; 1.0 represents right alignment.

-> m () 

Sets the X alignment of the frame widget’s label. The default value for a newly created frame is 0.0.

setLabelWidget

frameSetLabelWidget Source #

Arguments

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

frame: a Frame

-> Maybe b

labelWidget: the new label widget

-> m () 

Sets the Frame:label-widget for the frame. This is the widget that will appear embedded in the top edge of the frame as a title.

Properties

child

No description available in the introspection data.

clearFrameChild :: (MonadIO m, IsFrame o) => o -> m () Source #

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

clear #child

constructFrameChild :: (IsFrame o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

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

getFrameChild :: (MonadIO m, IsFrame o) => o -> m (Maybe Widget) Source #

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

get frame #child

setFrameChild :: (MonadIO m, IsFrame o, IsWidget a) => o -> a -> m () Source #

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

set frame [ #child := value ]

label

No description available in the introspection data.

clearFrameLabel :: (MonadIO m, IsFrame o) => o -> m () Source #

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

clear #label

constructFrameLabel :: (IsFrame o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getFrameLabel :: (MonadIO m, IsFrame o) => o -> m (Maybe Text) Source #

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

get frame #label

setFrameLabel :: (MonadIO m, IsFrame o) => o -> Text -> m () Source #

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

set frame [ #label := value ]

labelWidget

No description available in the introspection data.

clearFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m () Source #

Set the value of the “label-widget” property to Nothing. When overloading is enabled, this is equivalent to

clear #labelWidget

constructFrameLabelWidget :: (IsFrame o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

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

getFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m (Maybe Widget) Source #

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

get frame #labelWidget

setFrameLabelWidget :: (MonadIO m, IsFrame o, IsWidget a) => o -> a -> m () Source #

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

set frame [ #labelWidget := value ]

labelXalign

No description available in the introspection data.

constructFrameLabelXalign :: (IsFrame o, MonadIO m) => Float -> m (GValueConstruct o) Source #

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

getFrameLabelXalign :: (MonadIO m, IsFrame o) => o -> m Float Source #

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

get frame #labelXalign

setFrameLabelXalign :: (MonadIO m, IsFrame o) => o -> Float -> m () Source #

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

set frame [ #labelXalign := value ]