gtk.frame

Module for [Frame] class

Types 3

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 gtk.frame.Frame.setLabelAlign.

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

<object class="GtkFrame">
  <child type="label">
    <object class="GtkLabel" id="frame-label"/>
  </child>
  <child>
    <object class="GtkEntry" id="frame-content"/>
  </child>
</object>

CSS nodes

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 gtk.frame.Frame.setShadowType with gtk.types.ShadowType.None to add the “.flat” class or any other shadow type to remove it.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
Frame self() nothrowReturns `this`, for use in `with` statements.
FrameGidBuilder builder() static nothrowGet builder for [gtk.frame.Frame] Returns: New builder object
string label() @property nothrow
void label(string propval) @property nothrow
gtk.widget.Widget labelWidget() @property nothrow
void labelWidget(gtk.widget.Widget propval) @property nothrow
float labelXalign() @property nothrow
void labelXalign(float propval) @property nothrow
float labelYalign() @property nothrow
void labelYalign(float propval) @property nothrow
gtk.types.ShadowType shadowType() @property nothrow
void shadowType(gtk.types.ShadowType propval) @property nothrow
string getLabel() nothrowIf the frame’s label widget is a #GtkLabel, returns the text in the label widget. (The frame will have a #GtkLabel for the label widget if a non-null argument was passed to [gtk.frame.Frame.new_]...
void getLabelAlign(out float xalign, out float yalign) nothrowRetrieves the X and Y alignment of the frame’s label. See [gtk.frame.Frame.setLabelAlign].
gtk.widget.Widget getLabelWidget() nothrowRetrieves the label widget for the frame. See [gtk.frame.Frame.setLabelWidget]. Returns: the label widget, or null if there is none.
gtk.types.ShadowType getShadowType() nothrowRetrieves the shadow type of the frame. See [gtk.frame.Frame.setShadowType]. Returns: the current shadow type of the frame.
void setLabel(string label = null) nothrowRemoves the current #GtkFrame:label-widget. If label is not null, creates a new #GtkLabel with that text and adds it as the #GtkFrame:label-widget.
void setLabelAlign(float xalign, float yalign) nothrowSets the alignment of the frame widget’s label. The default values for a newly created frame are 0.0 and 0.5.
void setLabelWidget(gtk.widget.Widget labelWidget = null) nothrowSets the #GtkFrame:label-widget for the frame. This is the widget that will appear embedded in the top edge of the frame as a title.
void setShadowType(gtk.types.ShadowType type) nothrowSets the #GtkFrame:shadow-type for frame, i.e. whether it is drawn without ([gtk.types.ShadowType.None]) or with (other values) a visible border. Values other than [gtk.types.ShadowType.None] are t...
Constructors
this(void * ptr, Flag!"Take" take)
this(string label = null)Creates a new #GtkFrame, with optional label label. If label is null, the label is omitted.

Fluent builder implementation template for gtk.frame.Frame

Methods
T label(string propval) nothrow
T labelWidget(gtk.widget.Widget propval) nothrow
T labelXalign(float propval) nothrow
T labelYalign(float propval) nothrow
T shadowType(gtk.types.ShadowType propval) nothrow

Fluent builder for gtk.frame.Frame

Methods
Frame build() nothrowCreate object from builder. Returns: New object