GtkWindowControls — A widget displaying window buttons
GtkWidget * | gtk_window_controls_new () |
GtkPackType | gtk_window_controls_get_side () |
void | gtk_window_controls_set_side () |
const char * | gtk_window_controls_get_decoration_layout () |
void | gtk_window_controls_set_decoration_layout () |
gboolean | gtk_window_controls_get_empty () |
char * | decoration-layout | Read / Write |
gboolean | empty | Read |
GtkPackType | side | Read / Write |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkWindowControls
GtkWindowControls implements GtkAccessible, GtkBuildable and GtkConstraintTarget.
#include <gtk/gtk.h>
GtkWindowControls shows window frame controls, such as minimize, maximize and close buttons, and the window icon.
GtkWindowControls only displays start or end side of the controls (see “side”), so it's intended to be always used in pair with another GtkWindowControls using the opposite side, for example:
<object class="GtkBox"> <child> <object class="GtkWindowControls"> <property name="side">start</property> </object> </child> ... <child> <object class="GtkWindowControls"> <property name="side">end</property> </object> </child> </object>
A GtkWindowControls' CSS node is called windowcontrols. It contains subnodes corresponding to each title button. Which of the title buttons exist and where they are placed exactly depends on the desktop environment and “decoration-layout” value.
When “empty” is TRUE
, it gets the .empty style class.
GtkWindowHandle uses the GTK_ACCESSIBLE_ROLE_GROUP
role.
GtkWidget *
gtk_window_controls_new (GtkPackType side
);
Creates a new GtkWindowControls.
side | the side |
a new GtkWindowControls.
GtkPackType
gtk_window_controls_get_side (GtkWindowControls *self
);
Gets the side set with gtk_window_controls_set_side()
.
self |
the side
void gtk_window_controls_set_side (GtkWindowControls *self
,GtkPackType side
);
Sets the side for self
, determining which part of decoration layout it uses.
See gtk_window_controls_set_decoration_layout()
self | ||
side | a side |
const char *
gtk_window_controls_get_decoration_layout
(GtkWindowControls *self
);
Gets the decoration layout set with gtk_window_controls_set_decoration_layout()
.
self |
the decoration layout or NULL
if it is unset.
[nullable]
void gtk_window_controls_set_decoration_layout (GtkWindowControls *self
,const char *layout
);
Sets the decoration layout for the title buttons, overriding the “gtk-decoration-layout” setting.
The format of the string is button names, separated by commas. A colon separates the buttons that should appear on the left from those on the right. Recognized button names are minimize, maximize, close and icon (the window icon).
For example, “icon:minimize,maximize,close” specifies a icon on the left, and minimize, maximize and close buttons on the right.
If “side” value is GTK_PACK_START
, self
will display the part before the colon, otherwise after that.
self | ||
layout | a decoration layout, or | [nullable] |
gboolean
gtk_window_controls_get_empty (GtkWindowControls *self
);
Gets whether the widget has any window buttons.
self |
TRUE
if the widget has window buttons, otherwise FALSE
typedef struct _GtkWindowControls GtkWindowControls;
“decoration-layout”
property“decoration-layout” char *
The decoration layout for window buttons. If this property is not set, the “gtk-decoration-layout” setting is used.
See gtk_window_controls_set_decoration_layout()
for information about the format of this string.
Owner: GtkWindowControls
Flags: Read / Write
Default value: NULL
“empty”
property“empty” gboolean
Whether the widget has any window buttons.
Owner: GtkWindowControls
Flags: Read
Default value: TRUE
“side”
property“side” GtkPackType
Whether the widget shows start or end side of the decoration layout.
See gtk_window_controls_set_decoration_layout()
.
Owner: GtkWindowControls
Flags: Read / Write
Default value: GTK_PACK_START
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkWindowControls.html