Gtk.CssSection¶
Fields¶
None
Methods¶
|
|
|
|
|
|
|
|
|
Details¶
- class Gtk.CssSection¶
Defines a part of a CSS document. Because sections are nested into one another, you can use
Gtk.CssSection.get_parent
() to get the containing region.New in version 3.2.
- get_end_line()[source]¶
- Returns:
the line number
- Return type:
Returns the line in the CSS document where this section end. The line number is 0-indexed, so the first line of the document will return 0. This value may change in future invocations of this function if self is not yet parsed completely. This will for example happen in the
Gtk.CssProvider
::parsing-error
signal. The end position and line may be identical to the start position and line for sections which failed to parse anything successfully.New in version 3.2.
- get_end_position()[source]¶
- Returns:
the offset in bytes from the start of the line.
- Return type:
Returns the offset in bytes from the start of the current line returned via
Gtk.CssSection.get_end_line
(). This value may change in future invocations of this function if self is not yet parsed completely. This will for example happen in theGtk.CssProvider
::parsing-error
signal. The end position and line may be identical to the start position and line for sections which failed to parse anything successfully.New in version 3.2.
- get_file()[source]¶
- Returns:
the
Gio.File
that self was parsed from orNone
if self was parsed from other data- Return type:
Gets the file that self was parsed from. If no such file exists, for example because the CSS was loaded via gtk_css_provider_load_from_data(), then
None
is returned.New in version 3.2.
- get_parent()[source]¶
- Returns:
the parent section or
None
if none- Return type:
Gets the parent section for the given self. The parent section is the section that contains this self. A special case are sections of type
Gtk.CssSectionType.DOCUMENT
. Their parent will either beNone
if they are the original CSS document that was loaded byGtk.CssProvider.load_from_file
() or a section of typeGtk.CssSectionType.IMPORT
if it was loaded with an import rule from a different file.New in version 3.2.
- get_section_type()[source]¶
- Returns:
the type of self
- Return type:
Gets the type of information that self describes.
New in version 3.2.
- get_start_line()[source]¶
- Returns:
the line number
- Return type:
Returns the line in the CSS document where this section starts. The line number is 0-indexed, so the first line of the document will return 0.
New in version 3.2.
- get_start_position()[source]¶
- Returns:
the offset in bytes from the start of the line.
- Return type:
Returns the offset in bytes from the start of the current line returned via
Gtk.CssSection.get_start_line
().New in version 3.2.