:right-sidebar: True CssSection =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: CssSection(**kwargs) :no-contents-entry: :Constructors: :: new(file:Gio.File=None, start:Gtk.CssLocation, end:Gtk.CssLocation) -> Gtk.CssSection Constructors ------------ .. rst-class:: interim-class .. class:: CssSection :no-index: .. classmethod:: new(file: ~gi.repository.Gio.File | None, start: ~gi.repository.Gtk.CssLocation, end: ~gi.repository.Gtk.CssLocation) -> ~gi.repository.Gtk.CssSection Creates a new ``GtkCssSection`` referring to the section in the given ``file`` from the ``start`` location to the ``end`` location. :param file: The file this section refers to :param start: The start location :param end: The end location Methods ------- .. rst-class:: interim-class .. class:: CssSection :no-index: .. method:: get_end_location() -> ~gi.repository.Gtk.CssLocation Returns the location in the CSS document where this section ends. .. method:: get_file() -> ~gi.repository.Gio.File | None Gets the file that ``section`` was parsed from. If no such file exists, for example because the CSS was loaded via :obj:`~gi.repository.Gtk.CssProvider.load_from_data`, then ``NULL`` is returned. .. method:: get_parent() -> ~gi.repository.Gtk.CssSection | None Gets the parent section for the given ``section``. The parent section is the section that contains this ``section``. A special case are sections of type ``GTK_CSS_SECTION_DOCUMEN``T. Their parent will either be ``NULL`` if they are the original CSS document that was loaded by :obj:`~gi.repository.Gtk.CssProvider.load_from_file` or a section of type ``GTK_CSS_SECTION_IMPORT`` if it was loaded with an ```import``` rule from a different file. .. method:: get_start_location() -> ~gi.repository.Gtk.CssLocation Returns the location in the CSS document where this section starts. .. method:: print_(string: ~gi.repository.GLib.String) -> None :param string: .. method:: to_string() -> str Prints the section into a human-readable text form using :obj:`~gi.repository.Gtk.CssSection.print`.