Declaration [src]

gtk_widget_set_name (
  GtkWidget* widget,
  const char* name

Description [src]

Sets a widgets name.

Setting a name allows you to refer to the widget from a CSS file. You can apply a style to widgets with a particular name in the CSS file. See the documentation for the CSS syntax (on the same page as the docs for GtkStyleContext.

Note that the CSS syntax has certain special characters to delimit and represent elements in a selector (period, #, >, *…), so using these will make your widget impossible to match by name. Any combination of alphanumeric symbols, dashes and underscores will suffice.

Sets propertyGtk.Widget:name



Type: const char*

Name for the widget.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.