gi-gtk-3.0.26: 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.Frame

Contents

Description

The frame widget is a bin that surrounds its child with a decorative frame and an optional label. If present, the label is drawn in a gap in the top side of the frame. The 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
├── border[.flat]
├── <label widget>
╰── <child>

GtkFrame has a main CSS node named “frame” and a subnode named “border”. The “border” node is used to draw the visible border. You can set the appearance of the border using CSS properties like “border-style” on the “border” node.

The border node can be given the style class “.flat”, which is used by themes to disable drawing of the border. To do this from code, call frameSetShadowType with ShadowTypeNone to add the “.flat” class or any other shadow type to remove it.

Synopsis

Exported types

newtype Frame Source #

Memory-managed wrapper type.

Constructors

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

Defined in GI.Gtk.Objects.Frame

Methods

gobjectType :: Frame -> IO GType #

IsImplementorIface Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

IsObject Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

IsBuildable Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

IsBin Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

IsContainer Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

IsFrame Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

IsWidget Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

class GObject o => IsFrame o Source #

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

Instances
(GObject a, (UnknownAncestorError Frame a :: Constraint)) => IsFrame a Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

IsFrame Frame Source # 
Instance details

Defined in GI.Gtk.Objects.Frame

IsFrame AspectFrame Source # 
Instance details

Defined in GI.Gtk.Objects.AspectFrame

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.

noFrame :: Maybe Frame Source #

A convenience alias for Nothing :: Maybe Frame.

Methods

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, Float) 

Retrieves the X and Y 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.

getShadowType

frameGetShadowType Source #

Arguments

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

frame: a Frame

-> m ShadowType

Returns: the current shadow type of the frame.

Retrieves the shadow type of the frame. See frameSetShadowType.

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.

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.

-> Float

yalign: The y alignment of the label. A value of 0.0 aligns under the frame; 1.0 aligns above the frame. If the values are exactly 0.0 or 1.0 the gap in the frame won’t be painted because the label will be completely above or below the frame.

-> m () 

Sets the alignment of the frame widget’s label. The default values for a newly created frame are 0.0 and 0.5.

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.

setShadowType

frameSetShadowType Source #

Arguments

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

frame: a Frame

-> ShadowType

type: the new ShadowType

-> m () 

Sets the Frame:shadow-type for frame, i.e. whether it is drawn without (ShadowTypeNone) or with (other values) a visible border. Values other than ShadowTypeNone are treated identically by GtkFrame. The chosen type is applied by removing or adding the .flat class to the CSS node named border.

Properties

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 => Text -> IO (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, IsWidget a) => a -> IO (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 => Float -> IO (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 ]

labelYalign

No description available in the introspection data.

constructFrameLabelYalign :: IsFrame o => Float -> IO (GValueConstruct o) Source #

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

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

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

get frame #labelYalign

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

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

set frame [ #labelYalign := value ]

shadowType

No description available in the introspection data.

constructFrameShadowType :: IsFrame o => ShadowType -> IO (GValueConstruct o) Source #

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

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

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

get frame #shadowType

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

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

set frame [ #shadowType := value ]