Frame

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_set_label_align().

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: |[ <object class="GtkFrame"> <child type="label"> <object class="GtkLabel" id="frame-label"/> </child> <child> <object class="GtkEntry" id="frame-content"/> </child> </object> ]|

CSS nodes

|[<!-- language="plain" --> 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 style class .flat can appear with the main node.

Constructors

this
this(GtkFrame* gtkFrame, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(Widget widget, string label)

Creates frame with label and set it's child widget

this
this(string label)

Creates a new #GtkFrame, with optional label @label. If @label is %NULL, the label is omitted.

Members

Functions

getFrameStruct
GtkFrame* getFrameStruct()

Get the main Gtk struct

getLabel
string getLabel()

If 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_new().)

getLabelAlign
void getLabelAlign(float xalign, float yalign)

Retrieves the X and Y alignment of the frame’s label. See gtk_frame_set_label_align().

getLabelWidget
Widget getLabelWidget()

Retrieves the label widget for the frame. See gtk_frame_set_label_widget().

getShadowType
GtkShadowType getShadowType()

Retrieves the shadow type of the frame. See gtk_frame_set_shadow_type().

getStruct
void* getStruct()

the main Gtk struct as a void*

setLabel
void setLabel(string label)

Sets the text of the label. If @label is %NULL, the current label is removed.

setLabelAlign
void setLabelAlign(float xalign, float yalign)

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

setLabelWidget
void setLabelWidget(Widget labelWidget)

Sets the label widget for the frame. This is the widget that will appear embedded in the top edge of the frame as a title.

setShadowType
void setShadowType(GtkShadowType type)

Sets the shadow type for @frame.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

getType
GType getType()

Variables

gtkFrame
GtkFrame* gtkFrame;

the main Gtk struct

Inherited Members

From Bin

gtkBin
GtkBin* gtkBin;

the main Gtk struct

getBinStruct
GtkBin* getBinStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getType
GType getType()
getChild
Widget getChild()

Gets the child of the #GtkBin, or %NULL if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.

Meta