Package: gtk

Class gtk-frame

Superclasses

gtk-bin, gtk-container, gtk-widget, gtk-buildable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

Direct Slots

label
The label property of type :string (Read / Write)
Text of the frame's label.
Default value: nil
label-widget
The label-widget property of type gtk-widget (Read / Write)
A widget to display in place of the usual frame label.
label-xalign
The label-xalign property of type :float (Read / Write)
The horizontal alignment of the label.
Allowed values: [0.0, 1.0]
Default value: 0.0
label-yalign
The label-yalign property of type :float (Read / Write)
The vertical alignment of the label.
Allowed values: [0.0, 1.0]
Default value: 0.5
shadow-type
The shadow-type property of type gtk-shadow-type (Read / Write)
Appearance of the frame border.
Default value: :etched-in

Details

The frame widget is a gtk-bin widget 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 the function gtk-frame-label-align.

GtkFrame as GtkBuildable

The gtk-frame widget implementation of the gtk-buildable 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: A UI definition fragment with a gtk-frame widget
 <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>    
The gtk-frame implementation 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 .flat style class, which is used by themes to disable drawing of the border. To do this from code, call the gtk-frame-shadow-type function with the :none value to add the .flat style class or any other shadow type to remove it.
 

Slot Access Functions

Inherited Slot Access Functions

See also

*2021-5-23