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 |
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 :: IsFrame o => o -> IO Frame
- noFrame :: Maybe Frame
- data FrameGetLabelMethodInfo
- frameGetLabel :: (HasCallStack, MonadIO m, IsFrame a) => a -> m (Maybe Text)
- data FrameGetLabelAlignMethodInfo
- frameGetLabelAlign :: (HasCallStack, MonadIO m, IsFrame a) => a -> m (Float, Float)
- data FrameGetLabelWidgetMethodInfo
- frameGetLabelWidget :: (HasCallStack, MonadIO m, IsFrame a) => a -> m (Maybe Widget)
- data FrameGetShadowTypeMethodInfo
- frameGetShadowType :: (HasCallStack, MonadIO m, IsFrame a) => a -> m ShadowType
- frameNew :: (HasCallStack, MonadIO m) => Maybe Text -> m Frame
- data FrameSetLabelMethodInfo
- frameSetLabel :: (HasCallStack, MonadIO m, IsFrame a) => a -> Maybe Text -> m ()
- data FrameSetLabelAlignMethodInfo
- frameSetLabelAlign :: (HasCallStack, MonadIO m, IsFrame a) => a -> Float -> Float -> m ()
- data FrameSetLabelWidgetMethodInfo
- frameSetLabelWidget :: (HasCallStack, MonadIO m, IsFrame a, IsWidget b) => a -> Maybe b -> m ()
- data FrameSetShadowTypeMethodInfo
- frameSetShadowType :: (HasCallStack, MonadIO m, IsFrame a) => a -> ShadowType -> m ()
- data FrameLabelPropertyInfo
- clearFrameLabel :: (MonadIO m, IsFrame o) => o -> m ()
- constructFrameLabel :: IsFrame o => Text -> IO (GValueConstruct o)
- frameLabel :: AttrLabelProxy "label"
- getFrameLabel :: (MonadIO m, IsFrame o) => o -> m (Maybe Text)
- setFrameLabel :: (MonadIO m, IsFrame o) => o -> Text -> m ()
- data FrameLabelWidgetPropertyInfo
- clearFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m ()
- constructFrameLabelWidget :: (IsFrame o, IsWidget a) => a -> IO (GValueConstruct o)
- frameLabelWidget :: AttrLabelProxy "labelWidget"
- getFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m (Maybe Widget)
- setFrameLabelWidget :: (MonadIO m, IsFrame o, IsWidget a) => o -> a -> m ()
- data FrameLabelXalignPropertyInfo
- constructFrameLabelXalign :: IsFrame o => Float -> IO (GValueConstruct o)
- frameLabelXalign :: AttrLabelProxy "labelXalign"
- getFrameLabelXalign :: (MonadIO m, IsFrame o) => o -> m Float
- setFrameLabelXalign :: (MonadIO m, IsFrame o) => o -> Float -> m ()
- data FrameLabelYalignPropertyInfo
- constructFrameLabelYalign :: IsFrame o => Float -> IO (GValueConstruct o)
- frameLabelYalign :: AttrLabelProxy "labelYalign"
- getFrameLabelYalign :: (MonadIO m, IsFrame o) => o -> m Float
- setFrameLabelYalign :: (MonadIO m, IsFrame o) => o -> Float -> m ()
- data FrameShadowTypePropertyInfo
- constructFrameShadowType :: IsFrame o => ShadowType -> IO (GValueConstruct o)
- frameShadowType :: AttrLabelProxy "shadowType"
- getFrameShadowType :: (MonadIO m, IsFrame o) => o -> m ShadowType
- setFrameShadowType :: (MonadIO m, IsFrame o) => o -> ShadowType -> m ()
Exported types
GObject Frame Source # | |
IsImplementorIface Frame Source # | |
IsObject Frame Source # | |
IsWidget Frame Source # | |
IsFrame Frame Source # | |
IsContainer Frame Source # | |
IsBin Frame Source # | |
IsBuildable Frame Source # | |
((~) * info (ResolveFrameMethod t Frame), MethodInfo * info Frame p) => IsLabel t (Frame -> p) Source # | |
((~) * info (ResolveFrameMethod t Frame), MethodInfo * info Frame p) => IsLabelProxy t (Frame -> p) Source # | |
HasAttributeList * Frame Source # | |
type AttributeList Frame Source # | |
type SignalList Frame Source # | |
class GObject o => IsFrame o Source #
(GObject a, UnknownAncestorError Constraint Frame a) => IsFrame a Source # | |
IsFrame Frame Source # | |
IsFrame AspectFrame Source # | |
Methods
getLabel
data FrameGetLabelMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsFrame a) => MethodInfo * FrameGetLabelMethodInfo a signature Source # | |
getLabelAlign
data FrameGetLabelAlignMethodInfo Source #
((~) * signature (m (Float, Float)), MonadIO m, IsFrame a) => MethodInfo * FrameGetLabelAlignMethodInfo a signature Source # | |
Retrieves the X and Y alignment of the frame’s label. See
frameSetLabelAlign
.
getLabelWidget
data FrameGetLabelWidgetMethodInfo Source #
((~) * signature (m (Maybe Widget)), MonadIO m, IsFrame a) => MethodInfo * FrameGetLabelWidgetMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsFrame a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the label widget, or |
Retrieves the label widget for the frame. See
frameSetLabelWidget
.
getShadowType
data FrameGetShadowTypeMethodInfo Source #
((~) * signature (m ShadowType), MonadIO m, IsFrame a) => MethodInfo * FrameGetShadowTypeMethodInfo a signature Source # | |
:: (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
data FrameSetLabelMethodInfo Source #
((~) * signature (Maybe Text -> m ()), MonadIO m, IsFrame a) => MethodInfo * FrameSetLabelMethodInfo a signature Source # | |
setLabelAlign
data FrameSetLabelAlignMethodInfo Source #
((~) * signature (Float -> Float -> m ()), MonadIO m, IsFrame a) => MethodInfo * FrameSetLabelAlignMethodInfo a signature Source # | |
:: (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
data FrameSetLabelWidgetMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsFrame a, IsWidget b) => MethodInfo * FrameSetLabelWidgetMethodInfo a signature Source # | |
:: (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
data FrameSetShadowTypeMethodInfo Source #
((~) * signature (ShadowType -> m ()), MonadIO m, IsFrame a) => MethodInfo * FrameSetShadowTypeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsFrame a) | |
=> a |
|
-> ShadowType |
|
-> m () |
Properties
label
data FrameLabelPropertyInfo Source #
clearFrameLabel :: (MonadIO m, IsFrame o) => o -> m () Source #
constructFrameLabel :: IsFrame o => Text -> IO (GValueConstruct o) Source #
frameLabel :: AttrLabelProxy "label" Source #
labelWidget
data FrameLabelWidgetPropertyInfo Source #
clearFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m () Source #
constructFrameLabelWidget :: (IsFrame o, IsWidget a) => a -> IO (GValueConstruct o) Source #
frameLabelWidget :: AttrLabelProxy "labelWidget" Source #
labelXalign
data FrameLabelXalignPropertyInfo Source #
constructFrameLabelXalign :: IsFrame o => Float -> IO (GValueConstruct o) Source #
frameLabelXalign :: AttrLabelProxy "labelXalign" Source #
labelYalign
data FrameLabelYalignPropertyInfo Source #
constructFrameLabelYalign :: IsFrame o => Float -> IO (GValueConstruct o) Source #
frameLabelYalign :: AttrLabelProxy "labelYalign" Source #
shadowType
data FrameShadowTypePropertyInfo Source #
constructFrameShadowType :: IsFrame o => ShadowType -> IO (GValueConstruct o) Source #
frameShadowType :: AttrLabelProxy "shadowType" Source #
getFrameShadowType :: (MonadIO m, IsFrame o) => o -> m ShadowType Source #
setFrameShadowType :: (MonadIO m, IsFrame o) => o -> ShadowType -> m () Source #