dzl-tree-node: Dazzle Reference Manual

## dzl-tree-node dzl-tree-node |

## Functions

DzlTreeNode * | dzl_tree_node_new ()
void | dzl_tree_node_append ()
void | dzl_tree_node_insert ()
void | dzl_tree_node_insert_sorted ()
gboolean | dzl_tree_node_is_root ()
const gchar * | dzl_tree_node_get_icon_name ()
GObject * | dzl_tree_node_get_item ()
DzlTreeNode * | dzl_tree_node_get_parent ()
GtkTreePath * | dzl_tree_node_get_path ()
gboolean | dzl_tree_node_get_iter ()
guint | dzl_tree_node_n_children ()
DzlTreeNode * | dzl_tree_node_nth_child ()
void | dzl_tree_node_prepend ()
void | dzl_tree_node_remove ()
void | dzl_tree_node_set_icon_name ()
void | dzl_tree_node_set_item ()
gboolean | dzl_tree_node_expand ()
void | dzl_tree_node_collapse ()
void | dzl_tree_node_select ()
void | dzl_tree_node_get_area ()
void | dzl_tree_node_invalidate ()
void | dzl_tree_node_rebuild ()
gboolean | dzl_tree_node_get_expanded ()
void | dzl_tree_node_show_popover ()
const gchar * | dzl_tree_node_get_text ()
void | dzl_tree_node_set_text ()
DzlTree * | dzl_tree_node_get_tree ()
gboolean | dzl_tree_node_get_children_possible ()
void | dzl_tree_node_set_children_possible ()
gboolean | dzl_tree_node_get_use_markup ()
void | dzl_tree_node_set_use_markup ()
GIcon * | dzl_tree_node_get_gicon ()
void | dzl_tree_node_set_gicon ()
void | dzl_tree_node_add_emblem ()
void | dzl_tree_node_remove_emblem ()
void | dzl_tree_node_clear_emblems ()
gboolean | dzl_tree_node_has_emblem ()
void | dzl_tree_node_set_emblems ()
gboolean | dzl_tree_node_get_use_dim_label ()
void | dzl_tree_node_set_use_dim_label ()
gboolean | dzl_tree_node_get_reset_on_collapse ()
void | dzl_tree_node_set_reset_on_collapse ()
const GdkRGBA * | dzl_tree_node_get_foreground_rgba ()
void | dzl_tree_node_set_foreground_rgba ()

## Description

## Functions

### dzl_tree_node_new ()

    DzlTreeNode *
    dzl_tree_node_new (void);

Creates a new DzlTreeNode instance. This is handy for situations where you do not want to subclass DzlTreeNode.

#### Returns

A DzlTreeNode.

[transfer full]

### dzl_tree_node_append ()

    void
    dzl_tree_node_append (DzlTreeNode *node,
                          DzlTreeNode *child);

Appends `child` to the list of children owned by `node` .

#### Parameters

node | A DzlTreeNode. |
child | A DzlTreeNode. |

### dzl_tree_node_insert ()

    void
    dzl_tree_node_insert (DzlTreeNode *self,
                          DzlTreeNode *child,
                          guint position);

Inserts `child` as a child of `self` at `position` .

#### Parameters

self | a DzlTreeNode |
child | a DzlTreeNode |
position | the position for the child |

Since: 3.28

### dzl_tree_node_insert_sorted ()

    void
    dzl_tree_node_insert_sorted (DzlTreeNode *node,
                                 DzlTreeNode *child,
                                 DzlTreeNodeCompareFunc compare_func,
                                 gpointer user_data);

Inserts a `child` as a child of `node` , sorting it among the other children.

#### Parameters

node | A DzlTreeNode. |
child | A DzlTreeNode. |
compare_func | A compare func to compare nodes. | [scope call]
user_data | user data for `compare_func` . |

### dzl_tree_node_is_root ()

    gboolean
    dzl_tree_node_is_root (DzlTreeNode *node);

### dzl_tree_node_get_icon_name ()

    const gchar *
    dzl_tree_node_get_icon_name (DzlTreeNode *node);

Fetches the icon-name of the icon to display, or NULL for no icon.

### dzl_tree_node_get_item ()

    GObject *
    dzl_tree_node_get_item (DzlTreeNode *node);

Gets a GObject for the node, if one was set.

#### Parameters

node | A DzlTreeNode. | [in]

#### Returns

A GObject or `NULL`.

[transfer none]

### dzl_tree_node_get_parent ()

    DzlTreeNode *
    dzl_tree_node_get_parent (DzlTreeNode *node);

Retrieves the parent DzlTreeNode for `node` .

#### Parameters

node | A DzlTreeNode. | [in]

#### Returns

A DzlTreeNode.

[transfer none]

### dzl_tree_node_get_path ()

    GtkTreePath *
    dzl_tree_node_get_path (DzlTreeNode *node);

Gets a GtkTreePath for `node` .

#### Parameters

node | A DzlTreeNode. | [in]

#### Returns

A GtkTreePath if successful; otherwise `NULL`.

[nullable][transfer full]

### dzl_tree_node_get_iter ()

    gboolean
    dzl_tree_node_get_iter (DzlTreeNode *node,
                            GtkTreeIter *iter);

### dzl_tree_node_n_children ()

    guint
    dzl_tree_node_n_children (DzlTreeNode *self);

### dzl_tree_node_nth_child ()

    DzlTreeNode *
    dzl_tree_node_nth_child (DzlTreeNode *self,
                             guint nth);

Gets the `nth` child of `self` or `NULL` if it does not exist.

#### Parameters

self | a DzlTreeNode |
nth | the index of the child |

#### Returns

a DzlTreeNode or `NULL`.

[transfer full][nullable]

### dzl_tree_node_prepend ()

    void
    dzl_tree_node_prepend (DzlTreeNode *node,
                           DzlTreeNode *child);

Prepends `child` to the list of children owned by `node` .

#### Parameters

node | A DzlTreeNode. |
child | A DzlTreeNode. |

### dzl_tree_node_remove ()

    void
    dzl_tree_node_remove (DzlTreeNode *node,
                          DzlTreeNode *child);

Removes `child` from the list of children owned by `node` .

#### Parameters

node | A DzlTreeNode. |
child | A DzlTreeNode. |

### dzl_tree_node_set_icon_name ()

    void
    dzl_tree_node_set_icon_name (DzlTreeNode *node,
                                 const gchar *icon_name);

Sets the icon name of the node. This is displayed in the pixbuf cell of the DzlTree.

#### Parameters

node | A DzlTreeNode. |
icon_name | The icon name. | [nullable]

### dzl_tree_node_set_item ()

    void
    dzl_tree_node_set_item (DzlTreeNode *node,
                            GObject *item);

An optional object to associate with the node. This is handy to save needing to subclass the DzlTreeNode class.

#### Parameters

node | A DzlTreeNode. | [in]
item | A GObject. | [in]

### dzl_tree_node_expand ()

    gboolean
    dzl_tree_node_expand (DzlTreeNode *node,
                          gboolean expand_ancestors);

### dzl_tree_node_collapse ()

    void
    dzl_tree_node_collapse (DzlTreeNode *node);

### dzl_tree_node_select ()

    void
    dzl_tree_node_select (DzlTreeNode *node);

### dzl_tree_node_get_area ()

    void
    dzl_tree_node_get_area (DzlTreeNode *node,
                            GdkRectangle *area);

### dzl_tree_node_invalidate ()

    void
    dzl_tree_node_invalidate (DzlTreeNode *node);

### dzl_tree_node_rebuild ()

    void
    dzl_tree_node_rebuild (DzlTreeNode *self);

Rebuilds a node, without invalidating children nodes. If you want to ensure that children are also rebuilt, use `dzl_tree_node_invalidate()`.

#### Parameters

self | a DzlTreeNode |

Since: 3.28

### dzl_tree_node_get_expanded ()

    gboolean
    dzl_tree_node_get_expanded (DzlTreeNode *node);

### dzl_tree_node_show_popover ()

    void
    dzl_tree_node_show_popover (DzlTreeNode *node,
                                GtkPopover *popover);

### dzl_tree_node_get_text ()

    const gchar *
    dzl_tree_node_get_text (DzlTreeNode *node);

### dzl_tree_node_set_text ()

    void
    dzl_tree_node_set_text (DzlTreeNode *node,
                            const gchar *text);

Sets the text of the node. This is displayed in the text cell of the DzlTree.

#### Parameters

node | A DzlTreeNode. |
text | The node text. | [nullable]

### dzl_tree_node_get_tree ()

    DzlTree *
    dzl_tree_node_get_tree (DzlTreeNode *node);

Fetches the DzlTree instance that owns the node.

#### Parameters

node | A DzlTreeNode. | [in]

#### Returns

A DzlTree.

[transfer none]

### dzl_tree_node_get_children_possible ()

    gboolean
    dzl_tree_node_get_children_possible (DzlTreeNode *self);

### dzl_tree_node_set_children_possible ()

    void
    dzl_tree_node_set_children_possible (DzlTreeNode *self,
                                         gboolean children_possible);

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 registered DzlTreeBuilder instances.

#### Parameters

self | A DzlTreeNode. |
children_possible | If the node has children. |

### dzl_tree_node_get_use_markup ()

    gboolean
    dzl_tree_node_get_use_markup (DzlTreeNode *self);

### dzl_tree_node_set_use_markup ()

    void
    dzl_tree_node_set_use_markup (DzlTreeNode *self,
                                  gboolean use_markup);

### dzl_tree_node_get_gicon ()

    GIcon *
    dzl_tree_node_get_gicon (DzlTreeNode *self);

Fetch the GIcon, re-render if necessary

#### Returns

An GIcon or `NULL`.

[transfer none]

### dzl_tree_node_set_gicon ()

    void
    dzl_tree_node_set_gicon (DzlTreeNode *self,
                             GIcon *icon);

### dzl_tree_node_add_emblem ()

    void
    dzl_tree_node_add_emblem (DzlTreeNode *self,
                              const gchar *emblem_name);

Adds an emplem to be rendered on top of the node.

Use `dzl_tree_node_remove_emblem()` to remove an emblem.

#### Parameters

self | An DzlTreeNode |
emblem_name | the icon-name of the emblem |

### dzl_tree_node_remove_emblem ()

    void
    dzl_tree_node_remove_emblem (DzlTreeNode *self,
                                 const gchar *emblem_name);

### dzl_tree_node_clear_emblems ()

    void
    dzl_tree_node_clear_emblems (DzlTreeNode *self);

Removes all emblems from `self` .

### dzl_tree_node_has_emblem ()

    gboolean
    dzl_tree_node_has_emblem (DzlTreeNode *self,
                              const gchar *emblem_name);

Checks to see if `emblem_name` has been added to the DzlTreeNode.

#### Parameters

self | An DzlTreeNode |
emblem_name | a string containing the emblem name |

#### Returns

`TRUE` if `emblem_name` is used by `self`

### dzl_tree_node_set_emblems ()

    void
    dzl_tree_node_set_emblems (DzlTreeNode *self,
                               const gchar * const *emblems);

### dzl_tree_node_get_use_dim_label ()

    gboolean
    dzl_tree_node_get_use_dim_label (DzlTreeNode *self);

### dzl_tree_node_set_use_dim_label ()

    void
    dzl_tree_node_set_use_dim_label (DzlTreeNode *self,
                                     gboolean use_dim_label);

### dzl_tree_node_get_reset_on_collapse ()

    gboolean
    dzl_tree_node_get_reset_on_collapse (DzlTreeNode *self);

### dzl_tree_node_set_reset_on_collapse ()

    void
    dzl_tree_node_set_reset_on_collapse (DzlTreeNode *self,
                                         gboolean reset_on_collapse);

### dzl_tree_node_get_foreground_rgba ()

    const GdkRGBA *
    dzl_tree_node_get_foreground_rgba (DzlTreeNode *self);

Gets the foreground-rgba to use for row text.

If `NULL`, the default foreground color should be used.

#### Parameters

self | a DzlTreeNode |

#### Returns

A GdkRGBA or `NULL`.

[nullable][transfer none]

Since: 3.28

### dzl_tree_node_set_foreground_rgba ()

    void
    dzl_tree_node_set_foreground_rgba (DzlTreeNode *self,
                                       const GdkRGBA *foreground_rgba);

Sets the foreground-rgba to be used by the row text.

If `foreground_rgba` is `NULL`, the value is reset to the default.

#### Parameters

self | a DzlTreeNode |
foreground_rgba | A GdkRGBA or `NULL`. | [nullable]

Since: 3.28