Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
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[.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
- newtype Frame = Frame (ManagedPtr Frame)
- class (GObject o, IsDescendantOf Frame o) => IsFrame o
- toFrame :: (MonadIO m, IsFrame o) => o -> m 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, MonadIO m) => Text -> m (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, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getFrameLabelWidget :: (MonadIO m, IsFrame o) => o -> m (Maybe Widget)
- setFrameLabelWidget :: (MonadIO m, IsFrame o, IsWidget a) => o -> a -> m ()
- constructFrameLabelXalign :: (IsFrame o, MonadIO m) => Float -> m (GValueConstruct o)
- getFrameLabelXalign :: (MonadIO m, IsFrame o) => o -> m Float
- setFrameLabelXalign :: (MonadIO m, IsFrame o) => o -> Float -> m ()
- constructFrameLabelYalign :: (IsFrame o, MonadIO m) => Float -> m (GValueConstruct o)
- getFrameLabelYalign :: (MonadIO m, IsFrame o) => o -> m Float
- setFrameLabelYalign :: (MonadIO m, IsFrame o) => o -> Float -> m ()
- constructFrameShadowType :: (IsFrame o, MonadIO m) => ShadowType -> m (GValueConstruct o)
- getFrameShadowType :: (MonadIO m, IsFrame o) => o -> m ShadowType
- setFrameShadowType :: (MonadIO m, IsFrame o) => o -> ShadowType -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Frame Source # | |
GObject Frame Source # | |
Defined in GI.Gtk.Objects.Frame | |
ManagedPtrNewtype Frame Source # | |
Defined in GI.Gtk.Objects.Frame toManagedPtr :: Frame -> ManagedPtr Frame | |
TypedObject Frame Source # | |
Defined in GI.Gtk.Objects.Frame | |
HasParentTypes Frame Source # | |
Defined in GI.Gtk.Objects.Frame | |
IsGValue (Maybe Frame) Source # | Convert |
Defined in GI.Gtk.Objects.Frame gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Frame -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Frame) | |
type ParentTypes Frame Source # | |
class (GObject o, IsDescendantOf Frame o) => IsFrame o Source #
Instances
(GObject o, IsDescendantOf Frame o) => IsFrame o Source # | |
Defined in GI.Gtk.Objects.Frame |
Methods
Click to display all available methods, including inherited ones
Methods
activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.
Getters
getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getLabel, getLabelAlign, getLabelWidget, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getShadowType, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.
Setters
setAccelPath, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setLabel, setLabelAlign, setLabelWidget, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setShadowType, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.
getLabel
getLabelAlign
Retrieves the X and Y alignment of the frame’s label. See
frameSetLabelAlign
.
getLabelWidget
:: (HasCallStack, MonadIO m, IsFrame a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the label widget, or |
Retrieves the label widget for the frame. See
frameSetLabelWidget
.
getShadowType
:: (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
:: (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
:: (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
:: (HasCallStack, MonadIO m, IsFrame a) | |
=> a |
|
-> 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, 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 ]
labelYalign
No description available in the introspection data.
constructFrameLabelYalign :: (IsFrame o, MonadIO m) => Float -> m (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, MonadIO m) => ShadowType -> m (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 ]