Gda.TreeNode¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Node’s name attribute |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Gets emitted when a node has changed |
|
Gets emitted when a node has been removed |
|
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 |
|
Gets emitted when a node has been inserted |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
object |
r |
Class Details¶
- class Gda.TreeNode(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(name)¶
- Parameters:
- Returns:
a new
Gda.TreeNode
- Return type:
Creates a new
Gda.TreeNode
objectNew in version 4.2.
- fetch_attribute(attribute)¶
- Parameters:
attribute (
str
) – attribute name as a string- Returns:
a read-only
GObject.Value
, orNone
if not attribute named attribute has been set for self- Return type:
Get the value associated to the attribute named attribute for self. If the attribute is not set, then self's parents is queries (recursively up to the top level node).
Attributes can have any name, but Libgda proposes some default names, see ‘this section [libgda-40-Attributes-manager.synopsis]’.
New in version 4.2.
- get_child_index(index)¶
- Parameters:
index (
int
) – a index- Returns:
the
Gda.TreeNode
, orNone
if not found- Return type:
Get the
Gda.TreeNode
child of self at position index (starting at 0).New in version 4.2.
- get_child_name(name)¶
- Parameters:
name (
str
) – requested node’s name- Returns:
the
Gda.TreeNode
, orNone
if not found- Return type:
Get the
Gda.TreeNode
child of self which has theGda.ATTRIBUTE_NAME
set to nameNew in version 4.2.
- get_children()¶
- Returns:
a new
GLib.SList
ofGda.TreeNode
objects, orNone
if self does not have any child- Return type:
Get a list of all self's children, free it with g_slist_free() after usage
New in version 4.2.
- get_node_attribute(attribute)¶
- Parameters:
attribute (
str
) – attribute name as a string- Returns:
a read-only
GObject.Value
, orNone
if not attribute named attribute has been set for self- Return type:
Get the value associated to the attribute named attribute for self. The difference with
Gda.TreeNode.fetch_attribute
() is thatGda.TreeNode.fetch_attribute
() will also query self's parents (recursively up to the top level node) if the attribute is not set for self.Attributes can have any name, but Libgda proposes some default names, see ‘this section [libgda-40-Attributes-manager.synopsis]’.
New in version 4.2.
- get_parent()¶
- Returns:
the parent
Gda.TreeNode
- Return type:
Get the
Gda.TreeNode
parent of self in theGda.Tree
node belongs to. If self is at the top level, then this method returnNone
.New in version 4.2.
- set_node_attribute(attribute, value, destroy)¶
- Parameters:
attribute (
str
) – attribute namevalue (
GObject.Value
orNone
) – aGObject.Value
, orNone
destroy (
GLib.DestroyNotify
) – a function to be called when attribute is not needed anymore, orNone
Set the value associated to a named attribute. The attribute string is used AS IT IS by this method (eg. no copy of it is made), and the memory it uses will be freed using the destroy function when no longer needed (if destroy is
None
, then the string will not be freed at all).Attributes can have any name, but Libgda proposes some default names, see ‘this section [libgda-40-Attributes-manager.synopsis]’.
For example one would use it as:
Gda.TreeNode.set_node_attribute
(node,GLib.strdup
(my_attribute), my_value,GLib.free
);Gda.TreeNode.set_node_attribute
(node,Gda.ATTRIBUTE_NAME
, my_value,None
);If there is already an attribute named attribute set, then its value is replaced with the new value (value is copied), except if value is
None
, in which case the attribute is removed.New in version 4.2.
- do_dump_children(prefix, in_string) virtual¶
- Parameters:
prefix (
str
) –in_string (
GLib.String
) –
- do_node_changed(node) virtual¶
- Parameters:
node (
Gda.TreeNode
) –
- do_node_has_child_toggled(node) virtual¶
- Parameters:
node (
Gda.TreeNode
) –
- do_node_inserted(node) virtual¶
- Parameters:
node (
Gda.TreeNode
) –
Signal Details¶
- Gda.TreeNode.signals.node_changed(tree_node, node)¶
- Signal Name:
node-changed
- Flags:
- Parameters:
tree_node (
Gda.TreeNode
) – The object which received the signalnode (
Gda.TreeNode
) – theGda.TreeNode
which has changed
Gets emitted when a node has changed
New in version 4.2.
- Gda.TreeNode.signals.node_deleted(tree_node, relative_path)¶
- Signal Name:
node-deleted
- Flags:
- Parameters:
tree_node (
Gda.TreeNode
) – The object which received the signalrelative_path (
str
) – the path the node held, relative to reporting
Gets emitted when a node has been removed
New in version 4.2.
- Gda.TreeNode.signals.node_has_child_toggled(tree_node, node)¶
- Signal Name:
node-has-child-toggled
- Flags:
- Parameters:
tree_node (
Gda.TreeNode
) – The object which received the signalnode (
Gda.TreeNode
) – theGda.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.TreeNode.signals.node_inserted(tree_node, node)¶
- Signal Name:
node-inserted
- Flags:
- Parameters:
tree_node (
Gda.TreeNode
) – The object which received the signalnode (
Gda.TreeNode
) – theGda.TreeNode
which has been inserted
Gets emitted when a node has been inserted
New in version 4.2.