:right-sidebar: True TreeExpander =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: TreeExpander(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` :Constructors: :: TreeExpander(**properties) new() -> Gtk.Widget Constructors ------------ .. rst-class:: interim-class .. class:: TreeExpander :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``GtkTreeExpander`` Methods ------- .. rst-class:: interim-class .. class:: TreeExpander :no-index: .. method:: get_child() -> ~gi.repository.Gtk.Widget | None Gets the child widget displayed by ``self``. .. method:: get_hide_expander() -> bool Gets whether the TreeExpander should be hidden in a GtkTreeListRow. .. versionadded:: 4.10 .. method:: get_indent_for_depth() -> bool TreeExpander indents each level of depth with an additional indent. .. versionadded:: 4.10 .. method:: get_indent_for_icon() -> bool TreeExpander indents the child by the width of an expander-icon if it is not expandable. .. versionadded:: 4.6 .. method:: get_item() -> ~gi.repository.GObject.Object | None Forwards the item set on the ``GtkTreeListRow`` that ``self`` is managing. This call is essentially equivalent to calling: .. code-block:: c :dedent: gtk_tree_list_row_get_item (gtk_tree_expander_get_list_row (``self``)); .. method:: get_list_row() -> ~gi.repository.Gtk.TreeListRow | None Gets the list row managed by ``self``. .. method:: set_child(child: ~gi.repository.Gtk.Widget | None = None) -> None Sets the content widget to display. :param child: a ``GtkWidget`` .. method:: set_hide_expander(hide_expander: bool) -> None Sets whether the expander icon should be visible in a GtkTreeListRow. .. versionadded:: 4.10 :param hide_expander: TRUE if the expander should be hidden. Otherwise FALSE. .. method:: set_indent_for_depth(indent_for_depth: bool) -> None Sets if the TreeExpander should indent the child according to its depth. .. versionadded:: 4.10 :param indent_for_depth: TRUE if the child should be indented. Otherwise FALSE. .. method:: set_indent_for_icon(indent_for_icon: bool) -> None Sets if the TreeExpander should indent the child by the width of an expander-icon when it is not expandable. .. versionadded:: 4.6 :param indent_for_icon: TRUE if the child should be indented without expander. Otherwise FALSE. .. method:: set_list_row(list_row: ~gi.repository.Gtk.TreeListRow | None = None) -> None Sets the tree list row that this expander should manage. :param list_row: a ``GtkTreeListRow`` Properties ---------- .. rst-class:: interim-class .. class:: TreeExpander :no-index: .. attribute:: props.child :type: ~gi.repository.Gtk.Widget The child widget with the actual contents. .. attribute:: props.hide_expander :type: bool Whether the expander icon should be hidden in a GtkTreeListRow. Note that this property simply hides the icon. The actions and keybinding (i.e. collapse and expand) are not affected by this property. A common use for this property would be to bind to the number of children in a GtkTreeListRow's model in order to hide the expander when a row has no children. .. versionadded:: 4.10 .. attribute:: props.indent_for_depth :type: bool TreeExpander indents the child according to its depth. .. versionadded:: 4.10 .. attribute:: props.indent_for_icon :type: bool TreeExpander indents the child by the width of an expander-icon if it is not expandable. .. versionadded:: 4.6 .. attribute:: props.item :type: ~gi.repository.GObject.Object The item held by this expander's row. .. attribute:: props.list_row :type: ~gi.repository.Gtk.TreeListRow The list row to track for expander state.