Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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 ├── <label widget> ╰── <child>
GtkFrame has a main CSS node with name frame and a subnode with name border. The border node is used to render the visible border.
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 GTK_SHADOW_NONE to add the .flat class or
any other shadow type to remove it.
- newtype Frame = Frame (ManagedPtr Frame)
- class GObject o => IsFrame o
- toFrame :: (MonadIO m, IsFrame o) => o -> m Frame
- noFrame :: Maybe Frame
- frameGetLabel :: (HasCallStack, MonadIO m, IsFrame a) => a -> m (Maybe Text)
- frameGetLabelAlign :: (HasCallStack, MonadIO m, IsFrame a) => a -> m (Float, Float)
- frameGetLabelWidget :: (HasCallStack, MonadIO m, IsFrame a) => a -> m (Maybe Widget)
- frameGetShadowType :: (HasCallStack, MonadIO m, IsFrame a) => a -> m ShadowType
- frameNew :: (HasCallStack, MonadIO m) => Maybe Text -> m Frame
- frameSetLabel :: (HasCallStack, MonadIO m, IsFrame a) => a -> Maybe Text -> m ()
- frameSetLabelAlign :: (HasCallStack, MonadIO m, IsFrame a) => a -> Float -> Float -> m ()
- frameSetLabelWidget :: (HasCallStack, MonadIO m, IsFrame a, IsWidget b) => a -> Maybe b -> m ()
- frameSetShadowType :: (HasCallStack, MonadIO m, IsFrame a) => a -> ShadowType -> m ()
- clearFrameLabel :: (MonadIO m, IsFrame o) => o -> m ()
- constructFrameLabel :: IsFrame o => Text -> IO (GValueConstruct o)
- getFrameLabel :: (MonadIO m, IsFrame o) => o -> m (Maybe Text)
- setFrameLabel :: (MonadIO m, IsFrame o) => o -> Text -> m ()
- clearFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m ()
- constructFrameLabelWidget :: (IsFrame o, IsWidget a) => a -> IO (GValueConstruct o)
- getFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m (Maybe Widget)
- setFrameLabelWidget :: (MonadIO m, IsFrame o, IsWidget a) => o -> a -> m ()
- constructFrameLabelXalign :: IsFrame o => Float -> IO (GValueConstruct o)
- getFrameLabelXalign :: (MonadIO m, IsFrame o) => o -> m Float
- setFrameLabelXalign :: (MonadIO m, IsFrame o) => o -> Float -> m ()
- constructFrameLabelYalign :: IsFrame o => Float -> IO (GValueConstruct o)
- getFrameLabelYalign :: (MonadIO m, IsFrame o) => o -> m Float
- setFrameLabelYalign :: (MonadIO m, IsFrame o) => o -> Float -> m ()
- constructFrameShadowType :: IsFrame o => ShadowType -> IO (GValueConstruct o)
- getFrameShadowType :: (MonadIO m, IsFrame o) => o -> m ShadowType
- setFrameShadowType :: (MonadIO m, IsFrame o) => o -> ShadowType -> m ()
Exported types
Constructors
Frame (ManagedPtr Frame) |
class GObject o => IsFrame o Source #
Instances
(GObject a, UnknownAncestorError Constraint Frame a) => IsFrame a Source # | |
IsFrame Frame Source # | |
IsFrame AspectFrame Source # | |
Methods
getLabel
getLabelAlign
Retrieves the X and Y alignment of the frame’s label. See
frameSetLabelAlign
.
getLabelWidget
Arguments
:: (HasCallStack, MonadIO m, IsFrame a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the label widget, or |
Retrieves the label widget for the frame. See
frameSetLabelWidget
.
getShadowType
Arguments
:: (HasCallStack, MonadIO m, IsFrame a) | |
=> a |
|
-> m ShadowType | Returns: the current shadow type of the frame. |
Retrieves the shadow type of the frame. See
frameSetShadowType
.
new
setLabel
setLabelAlign
Arguments
:: (HasCallStack, MonadIO m, IsFrame a) | |
=> a |
|
-> Float |
|
-> Float |
|
-> 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
Arguments
:: (HasCallStack, MonadIO m, IsFrame a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> 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
Arguments
:: (HasCallStack, MonadIO m, IsFrame a) | |
=> a |
|
-> ShadowType |
|
-> m () |
Properties
label
clearFrameLabel :: (MonadIO m, IsFrame o) => o -> m () Source #
constructFrameLabel :: IsFrame o => Text -> IO (GValueConstruct o) Source #
labelWidget
clearFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m () Source #
constructFrameLabelWidget :: (IsFrame o, IsWidget a) => a -> IO (GValueConstruct o) Source #
labelXalign
constructFrameLabelXalign :: IsFrame o => Float -> IO (GValueConstruct o) Source #
labelYalign
constructFrameLabelYalign :: IsFrame o => Float -> IO (GValueConstruct o) Source #
shadowType
constructFrameShadowType :: IsFrame o => ShadowType -> IO (GValueConstruct o) Source #
getFrameShadowType :: (MonadIO m, IsFrame o) => o -> m ShadowType Source #
setFrameShadowType :: (MonadIO m, IsFrame o) => o -> ShadowType -> m () Source #