Next: , Previous: GtkExpander, Up: Top


103 GtkFrame

A bin with a decorative frame and optional label

103.1 Overview

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.

103.2 Usage

— Class: <gtk-frame>

Derives from <gtk-bin>.

This class defines the following slots:

label
Text of the frame's label
label-xalign
The horizontal alignment of the label
label-yalign
The vertical alignment of the label
shadow
Deprecated property, use shadow_type instead
shadow-type
Appearance of the frame border
label-widget
A widget to display in place of the usual frame label
— Function: gtk-frame-new (label mchars) ⇒  (ret <gtk-widget>)

Creates a new <gtk-frame>, with optional label label. If label is ‘#f’, the label is omitted.

label
the text to use as the label of the frame
ret
a new <gtk-frame> widget
— Function: gtk-frame-set-label (self <gtk-frame>) (label mchars)
— Method: set-label

Sets the text of the label. If label is ‘#f’, the current label is removed.

frame
a <gtk-frame>
label
the text to use as the label of the frame
— Function: gtk-frame-set-label-widget (self <gtk-frame>) (label_widget <gtk-widget>)
— Method: set-label-widget

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 <gtk-frame>
label-widget
the new label widget
— Function: gtk-frame-set-label-align (self <gtk-frame>) (xalign float) (yalign float)
— Method: set-label-align

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 <gtk-frame>
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.
— Function: gtk-frame-set-shadow-type (self <gtk-frame>) (type <gtk-shadow-type>)
— Method: set-shadow-type

Sets the shadow type for frame.

frame
a <gtk-frame>
type
the new <gtk-shadow-type>
— Function: gtk-frame-get-label (self <gtk-frame>) ⇒  (ret mchars)
— Method: get-label

If the frame's label widget is a <gtk-label>, returns the text in the label widget. (The frame will have a <gtk-label> for the label widget if a non-‘#f’ argument was passed to gtk-frame-new.)

frame
a <gtk-frame>
ret
the text in the label, or ‘#f’ if there was no label widget or the lable widget was not a <gtk-label>. This string is owned by GTK+ and must not be modified or freed.
— Function: gtk-frame-get-label-align (self <gtk-frame>) ⇒  (xalign float) (yalign float)
— Method: get-label-align

Retrieves the X and Y alignment of the frame's label. See gtk-frame-set-label-align.

frame
a <gtk-frame>
xalign
location to store X alignment of frame's label, or ‘#f
yalign
location to store X alignment of frame's label, or ‘#f
— Function: gtk-frame-get-label-widget (self <gtk-frame>) ⇒  (ret <gtk-widget>)
— Method: get-label-widget

Retrieves the label widget for the frame. See gtk-frame-set-label-widget.

frame
a <gtk-frame>
ret
the label widget, or ‘#f’ if there is none.
— Function: gtk-frame-get-shadow-type (self <gtk-frame>) ⇒  (ret <gtk-shadow-type>)
— Method: get-shadow-type

Retrieves the shadow type of the frame. See gtk-frame-set-shadow-type.

frame
a <gtk-frame>
ret
the current shadow type of the frame.