Dazzle.TreeNode¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Allows for lazy creation of children nodes. |
||
r/w |
The icon-name to use when the row is expanded |
||
r/w/en |
The |
||
r/w/en |
The icon name to display. |
||
r/w/en |
Optional object to associate with node. |
||
r |
The parent node. |
||
r/w/en |
Reset by clearing children on collapse, requiring a rebuild on next expand |
||
r/w/en |
The text of the node. |
||
r/w |
The |
||
r/w/en |
If text should be rendered with a dim label. |
||
r/w/en |
If text should be translated as markup. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Dazzle.TreeNode(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
- Return type:
Creates a new
Dazzle.TreeNode
instance. This is handy for situations where you do not want to subclassDazzle.TreeNode
.
- add_emblem(emblem_name)¶
- Parameters:
emblem_name (
str
) – the icon-name of the emblem
Adds an emplem to be rendered on top of the node.
Use
Dazzle.TreeNode.remove_emblem
() to remove an emblem.
- append(child)¶
- Parameters:
child (
Dazzle.TreeNode
) – ADazzle.TreeNode
.
Appends child to the list of children owned by self.
- clear_emblems()¶
Removes all emblems from self.
- collapse()¶
- get_area(area)¶
- Parameters:
area (
Gdk.Rectangle
) –
- get_foreground_rgba()¶
-
Gets the foreground-rgba to use for row text.
If
None
, the default foreground color should be used.New in version 3.28.
- get_item()¶
- Returns:
A
GObject.Object
orNone
.- Return type:
Gets a
GObject.Object
for the node, if one was set.
- get_iter(iter)¶
- Parameters:
iter (
Gtk.TreeIter
) –- Return type:
- get_parent()¶
- Returns:
- Return type:
Retrieves the parent
Dazzle.TreeNode
for self.
- get_path()¶
- Returns:
A
Gtk.TreePath
if successful; otherwiseNone
.- Return type:
Gtk.TreePath
orNone
Gets a
Gtk.TreePath
for self.
- get_tree()¶
- Returns:
A
Dazzle.Tree
.- Return type:
Fetches the
Dazzle.Tree
instance that owns the node.
- has_emblem(emblem_name)¶
- Parameters:
emblem_name (
str
) – a string containing the emblem name- Returns:
True
if emblem_name is used by self- Return type:
Checks to see if emblem_name has been added to the
Dazzle.TreeNode
.
- insert(child, position)¶
- Parameters:
child (
Dazzle.TreeNode
) – aDazzle.TreeNode
position (
int
) – the position for the child
Inserts child as a child of self at position.
New in version 3.28.
- insert_sorted(child, compare_func, *user_data)¶
- Parameters:
child (
Dazzle.TreeNode
) – ADazzle.TreeNode
.compare_func (
Dazzle.TreeNodeCompareFunc
) – A compare func to compare nodes.
Inserts a child as a child of self, sorting it among the other children.
- invalidate()¶
- nth_child(nth)¶
- Parameters:
nth (
int
) – the index of the child- Returns:
a
Dazzle.TreeNode
orNone
- Return type:
Gets the nth child of self or
None
if it does not exist.
- prepend(child)¶
- Parameters:
child (
Dazzle.TreeNode
) – ADazzle.TreeNode
.
Prepends child to the list of children owned by self.
- rebuild()¶
Rebuilds a node, without invalidating children nodes. If you want to ensure that children are also rebuilt, use
Dazzle.TreeNode.invalidate
().New in version 3.28.
- remove(child)¶
- Parameters:
child (
Dazzle.TreeNode
) – ADazzle.TreeNode
.
Removes child from the list of children owned by self.
- select()¶
- set_children_possible(children_possible)¶
- Parameters:
children_possible (
bool
) – If the node has children.
If the node has not yet been built, setting this to
True
will add a dummy child node. This dummy node will be removed when when the node is built by the registeredDazzle.TreeBuilder
instances.
- set_foreground_rgba(foreground_rgba)¶
-
Sets the foreground-rgba to be used by the row text.
If foreground_rgba is
None
, the value is reset to the default.New in version 3.28.
- set_icon_name(icon_name)¶
-
Sets the icon name of the node. This is displayed in the pixbuf cell of the
Dazzle.Tree
.
- set_item(item)¶
- Parameters:
item (
GObject.Object
) – AGObject.Object
.
An optional object to associate with the node. This is handy to save needing to subclass the
Dazzle.TreeNode
class.
- set_text(text)¶
-
Sets the text of the node. This is displayed in the text cell of the
Dazzle.Tree
.
- show_popover(popover)¶
- Parameters:
popover (
Gtk.Popover
) –
Property Details¶
- Dazzle.TreeNode.props.children_possible¶
-
This property allows for more lazy loading of nodes.
When a node becomes visible, we normally build its children nodes so that we know if we need an expansion arrow. However, that can be expensive when rendering directories with lots of subdirectories.
Using this, you can always show an arrow without building the children and simply hide the arrow if there were in fact no children (upon expansion).
- Dazzle.TreeNode.props.expanded_icon_name¶
-
The icon-name to use when the row is expanded
- Dazzle.TreeNode.props.gicon¶
- Name:
gicon
- Type:
- Default Value:
- Flags:
The cached
Gio.Icon
to display.
- Dazzle.TreeNode.props.icon_name¶
- Name:
icon-name
- Type:
- Default Value:
- Flags:
An icon-name to display on the row.
- Dazzle.TreeNode.props.item¶
- Name:
item
- Type:
- Default Value:
- Flags:
An optional
GObject.Object
to associate with the node.
- Dazzle.TreeNode.props.parent¶
- Name:
parent
- Type:
- Default Value:
- Flags:
The parent of the node.
- Dazzle.TreeNode.props.reset_on_collapse¶
- Name:
reset-on-collapse
- Type:
- Default Value:
- Flags:
The “reset-on-collapse” property denotes that all children should be removed from the node when it’s row is collapsed. It will also set
Dazzle.TreeNode
:needs-build
toTrue
so the next expansion rebuilds the children. This is useful for situations where you want to ensure the nodes are up to date (refreshed) on every expansion.New in version 3.28.
- Dazzle.TreeNode.props.text¶
- Name:
text
- Type:
- Default Value:
- Flags:
Text to display on the tree node.
- Dazzle.TreeNode.props.tree¶
- Name:
tree
- Type:
- Default Value:
- Flags:
The tree the node belongs to.
- Dazzle.TreeNode.props.use_dim_label¶
- Name:
use-dim-label
- Type:
- Default Value:
- Flags:
If text should be rendered with a dim label.