Libraries:Gtk:Gtk:Frame
Types
T
Inherits from: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 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.
Example 48. A UI definition fragment with GtkFrame
1 2 3 4 5 6 7 8 |
<object class="GtkFrame"> <child type="label"> <object class="GtkLabel" id="frame-label"/> </child> <child> <object class="GtkEntry" id="frame-content"/> </child> </object> |
Constants
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
New(label @ Std.String.T) : Gtk.Gtk.Frame.T
Creates a new T, with optional label label. If label is NULL, the label is omitted.
label | the text to use as the label of the frame |
Returns | a new T widget |
Methods
:GetLabel(self @ T) : Std.String.T
If the frame's label widget is a Gtk.Gtk.Label.T, returns the text in the label widget. (The frame will have a Gtk.Gtk.Label.T for the label widget if a non-NULL argument was passed to gtk_frame_new().)
frame | a T |
Returns | the text in the label, or NULL if there was no label widget or the lable widget was not a Gtk.Gtk.Label.T. This string is owned by GTK+ and must not be modified or freed. |
:GetLabelAlign(self @ T, xalign @ Std.Object.T, yalign @ Std.Object.T) : Std.Object.T
Retrieves the X and Y alignment of the frame's label. See SetLabelAlign.
frame | a T |
xalign | location to store X alignment of frame's label, or NULL. [out][allow-none] |
yalign | location to store X alignment of frame's label, or NULL. [out][allow-none] |
:GetLabelWidget(self @ T) : Gtk.Gtk.Widget.T
Retrieves the label widget for the frame. See SetLabelWidget.
:GetShadowType(self @ T) : Gtk.Gtk.ShadowType.T
Retrieves the shadow type of the frame. See SetShadowType.
frame | a T |
Returns | the current shadow type of the frame. |
:SetLabel(self @ T, label @ Std.String.T) : Std.Object.T
Sets the text of the label. If label is NULL, the current label is removed.
frame | a T |
label | the text to use as the label of the frame. [allow-none] |
:SetLabelAlign(self @ T, xalign @ Std.Real.T, yalign @ Std.Real.T) : Std.Object.T
Sets the alignment of the frame widget's label. The default values for a newly created frame are 0.0 and 0.5.
frame | a T |
xalign | The position of the label along the top edge of the widget. A value of 0.0 represents left alignment; 1.0 represents right alignment. |
yalign | The y alignment of the label. A value of 0.0 aligns under the frame; 1.0 aligns above the frame. If the values are exactly 0.0 or 1.0 the gap in the frame won't be painted because the label will be completely above or below the frame. |
:SetLabelWidget(self @ T, label_widget @ Gtk.Gtk.Widget.T) : Std.Object.T
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.
frame | a T |
label_widget | the new label widget |