Frame


Object Hierarchy:

Gtk.Frame Gtk.Frame Gtk.Frame Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Frame GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Gtk.Frame Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.Frame Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Gtk.Frame Gtk.ConstraintTarget->Gtk.Widget

Description:

[ CCode ( type_id = "gtk_frame_get_type ()" ) ]
public class Frame : Widget, Accessible, Buildable, ConstraintTarget

`GtkFrame` is a widget that surrounds its child with a decorative frame and an optional label.

![An example GtkFrame](frame.png)

If present, the label is drawn inside the top edge of the frame. The horizontal position of the label can be controlled with [ [email protected]_label_align].

`GtkFrame` clips its child. You can use this to add rounded corners to widgets, but be aware that it also cuts off shadows.

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: ```xml <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 ├── <label widget> ╰── <child> ```

`GtkFrame` has a main CSS node with name “frame”, which is used to draw the visible border. You can set the appearance of the border using CSS properties like “border-style” on this node.


Namespace: Gtk
Package: gtk4

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object



2022 vala-language.org