Gtk.StyleContext.prototype.add_region
function add_region(region_name:String, flags:Gtk.RegionFlags):void { // Gjs wrapper for gtk_style_context_add_region() }
Adds a region to context, so posterior calls to Gtk.get or any of the gtk_render_*() functions will make use of this new region for styling.
In the CSS file format, a Gtk.TreeView defining a "row" region, would be matched by:
<programlisting> GtkTreeView row { ... } </programlisting>
Pseudo-classes are used for matching flags, so the two following rules: <programlisting> GtkTreeView row:nth-child(even) { ... } GtkTreeView row:nth-child(odd) { ... } </programlisting>
would apply to even and odd rows, respectively.
<note><para>Region names must only contain lowercase letters and '-', starting always with a lowercase letter.</para></note>
Since 3.0
- region_name
region name to use in styling
- flags
flags that apply to the region