Gda.Tree

g GObject.Object GObject.Object Gda.Tree Gda.Tree GObject.Object->Gda.Tree

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class error_quark ()
class new ()
  add_manager (manager)
  clean ()
  dump (node, stream)
  get_node (tree_path, use_names)
  get_node_manager (node)
  get_node_path (node)
  get_nodes_in_path (tree_path, use_names)
  set_attribute (attribute, value, destroy)
  update_all ()
  update_children (node)
  update_part (node)

Virtual Methods

Inherited:GObject.Object (7)
  do_node_changed (node)
  do_node_deleted (node_path)
  do_node_has_child_toggled (node)
  do_node_inserted (node)

Properties

Name Type Flags Short Description
is-list bool r  

Signals

Inherited:GObject.Object (1)
Name Short Description
node-changed Gets emitted when a node has changed in tree
node-deleted Gets emitted when a node has been removed from tree
node-has-child-toggled Gets emitted when a node has has a child when it did not have any or when it does not have a ny children anymore when it had some
node-inserted Gets emitted when a node has been inserted in tree

Fields

Inherited:GObject.Object (1)
Name Type Access Description
object GObject.Object r  

Class Details

class Gda.Tree(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:Gda.TreeClass
classmethod error_quark()
Return type:int
classmethod new()
Returns:a new Gda.Tree object
Return type:Gda.Tree

Creates a new Gda.Tree object

New in version 4.2.

add_manager(manager)
Parameters:manager (Gda.TreeManager) – a Gda.TreeManager object

Sets manager as a top Gda.TreeManager object, which will be responsible for creating top level nodes in self.

New in version 4.2.

clean()

Removes any node in self

New in version 4.2.

dump(node, stream)
Parameters:

Dumps the contents of self to stream, using a hierarchical view.

New in version 4.2.

get_node(tree_path, use_names)
Parameters:
  • tree_path (str) – full path to the required nodes (if use_names is True, then it must start with ‘/’)
  • use_names (bool) – if True, then tree_path will be interpreted as a unix style path, and if False, then tree_path will be interpreted similarly to the #GtkTreePath’s string representation.
Returns:

the requested Gda.TreeNode pointer, or None if not found

Return type:

Gda.TreeNode or None

Locates a Gda.TreeNode using the tree_path path.

New in version 4.2.

get_node_manager(node)
Parameters:node (Gda.TreeNode) – a Gda.TreeNode present in self
Returns:the Gda.TreeManager, or None if node is not present in self
Return type:Gda.TreeManager

Get the Gda.TreeManager which created node in self

New in version 4.2.

get_node_path(node)
Parameters:node (Gda.TreeNode) – a Gda.TreeNode node in self
Returns:a new string, or None if node is not in self
Return type:str

Get the path associated to node in self.

New in version 4.2.

get_nodes_in_path(tree_path, use_names)
Parameters:
  • tree_path (str or None) – full path to the required nodes (if use_names is True, then it must start with ‘/’), or None
  • use_names (bool) – if True, then tree_path will be interpreted as a unix style path, and if False, then tree_path will be interpreted similarly to the #GtkTreePath’s string representation.
Returns:

a new list of Gda.TreeNode pointers, free it with g_slist_free()

Return type:

[Gda.TreeNode]

The returned list is a list of all the Gda.TreeNode nodes below the node at the specified path.

As a corner case if tree_path is None, then the returned list contains all the top level nodes.

New in version 4.2.

set_attribute(attribute, value, destroy)
Parameters:

Sets an attribute to self, which will be accessible to any node in it.

New in version 4.2.

update_all()
Raises:GLib.Error
Returns:True if no error occurred.
Return type:bool

Requests that self be populated with nodes. If an error occurs, then self’s contents is left unchanged, and otherwise self’s previous contents is completely replaced by the new one.

New in version 4.2.

update_children(node)
Parameters:node (Gda.TreeNode or None) – a Gda.TreeNode node in self, or None
Raises:GLib.Error
Returns:True if no error occurred.
Return type:bool

Update the children of node in self (not recursively, to update recursively, use Gda.Tree.update_part()). If node is None then the top level nodes are updated.

New in version 4.2.8.

update_part(node)
Parameters:node (Gda.TreeNode) – a Gda.TreeNode node in self
Raises:GLib.Error
Returns:True if no error occurred.
Return type:bool

Requests that self be populated with nodes, starting from node

New in version 4.2.

do_node_changed(node) virtual
Parameters:node (Gda.TreeNode) –
do_node_deleted(node_path) virtual
Parameters:node_path (str) –
do_node_has_child_toggled(node) virtual
Parameters:node (Gda.TreeNode) –
do_node_inserted(node) virtual
Parameters:node (Gda.TreeNode) –

Signal Details

Gda.Tree.signals.node_changed(tree, node)
Signal Name:

node-changed

Flags:

RUN_LAST

Parameters:

Gets emitted when a node has changed in tree

New in version 4.2.

Gda.Tree.signals.node_deleted(tree, node_path)
Signal Name:

node-deleted

Flags:

RUN_LAST

Parameters:
  • tree (Gda.Tree) – The object which received the signal
  • node_path (str) – the position the node held in tree as a tree path

Gets emitted when a node has been removed from tree

New in version 4.2.

Gda.Tree.signals.node_has_child_toggled(tree, node)
Signal Name:

node-has-child-toggled

Flags:

RUN_LAST

Parameters:
  • tree (Gda.Tree) – The object which received the signal
  • node (Gda.TreeNode) – the Gda.TreeNode which changed from having children to being a leaf or the other way around

Gets emitted when a node has has a child when it did not have any or when it does not have a ny children anymore when it had some

New in version 4.2.

Gda.Tree.signals.node_inserted(tree, node)
Signal Name:

node-inserted

Flags:

RUN_LAST

Parameters:

Gets emitted when a node has been inserted in tree

New in version 4.2.

Property Details

Gda.Tree.props.is_list
Name:is-list
Type:bool
Default Value:False
Flags:READABLE

Tells if the Gda.Tree is a list or a tree.