Gtk.CssSection¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gtk.CssSection¶
Defines a part of a CSS document.
Because sections are nested into one another, you can use [method`CssSection`.get_parent] to get the containing region.
- classmethod new(file, start, end)[source]¶
- Parameters:
start (
Gtk.CssLocation) – The start locationend (
Gtk.CssLocation) – The end location
- Returns:
a new
GtkCssSection- Return type:
Creates a new
GtkCssSectionreferring to the section in the givenfilefrom thestartlocation to theendlocation.
- classmethod new_with_bytes(file, bytes, start, end)[source]¶
- Parameters:
bytes (
GLib.BytesorNone) – The bytes this sections refers tostart (
Gtk.CssLocation) – The start locationend (
Gtk.CssLocation) – The end location
- Returns:
a new
GtkCssSection- Return type:
Creates a new
GtkCssSectionreferring to the section in the givenfileor the givenbytesfrom thestartlocation to theendlocation.New in version 4.16.
- get_bytes()[source]¶
- Returns:
the
GBytesfrom which thesectionwas parsed- Return type:
GLib.BytesorNone
Gets the bytes that self was parsed from.
New in version 4.16.
- get_end_location()[source]¶
- Returns:
The end location of this section
- Return type:
Returns the location in the CSS document where this section ends.
- get_file()[source]¶
-
Gets the file that self was parsed from.
If no such file exists, for example because the CSS was loaded via [method`Gtk`.CssProvider.load_from_data], then
NULLis returned.
- get_parent()[source]¶
- Returns:
the parent section
- Return type:
Gets the parent section for the given
section.The parent section is the section that contains this
section. A special case are sections of typeGTK_CSS_SECTION_DOCUMENT. Their parent will either beNULLif they are the original CSS document that was loaded by [method`Gtk`.CssProvider.load_from_file] or a section of typeGTK_CSS_SECTION_IMPORTif it was loaded with an@importrule from a different file.
- get_start_location()[source]¶
- Returns:
The start location of this section
- Return type:
Returns the location in the CSS document where this section starts.
- print_(string)[source]¶
- Parameters:
string (
GLib.String) – aGStringto print to
Prints the
sectionintostringin a human-readable form.This is a form like
gtk.css:32:1-23to denote line 32, characters 1 to 23 in the filegtk.css.
- ref()[source]¶
- Returns:
the CSS section itself.
- Return type:
Increments the reference count on
section.