Tagged: Node-Navigation TreeView
17 October 2018 at 05:17 #125000
I am using Cherrytree ver 0.38.4 running in Mint 17.3 and I am wondering:
1) Is there a navigational aid (shortcut key or menu) to move to the parent node of the current node? KeepNote has this feature.
2) Is there a way to display the path to the current node say in the Node Properties or as a pop up over the node? Currently when you show the Node Properties (in the Change Node Properties) it does not show a node’s full properties (no path to root).
3) It is nice to see buttons to create node as a sub-node or as a sibling node. A button to display the path would be a nice addition. At the moment in my rather large tree with many sub-levels, it is quite a clumsy task to see the path.
Jack19 October 2018 at 15:49 #125010
ctrl+tab toggles activation of the node tree and the Text-Editor.
While in Treeview-Widget you have somewhat control with the arrow/plus-minus/home-end and page up-down keys.
arrow-Left should go to next parent.19 October 2018 at 19:28 #125013
Something like this?
20 October 2018 at 12:19 #125014
Hi Thanks for that tip of Ctrl-Tab and in the Tree using the left arrow to go the parent.
Is there another key to move down one level?
Jack20 October 2018 at 12:27 #125015
Yes, that is what I would like to see. How did you cause Cherrytree to show that breadcrumb?
Jack20 October 2018 at 14:13 #125016
there __should__ be a a functionality to move to the next possbile node with childs in a tree.
I coudn’t find it either.
Showing the node path is afaik not possible with right now.
I edited the
to show the path instead of Nodes Title.
I am not really great in Python2 and PyGTK2 but I modified the method to show all titles of the path not just of the current node.
My Code for that is:
path = self.treestore.get_path(self.curr_tree_iter) count = len(path) x = 0 sep = " >> " val = "" pathname =  for i in path: if x == 0: citer = self.treestore.get_iter(path) else: citer = self.treestore.get_iter(path[0:x + 1]) val = self.treestore.get_value(citer, 0) pathname.append(val) if count > 1 and x < count - 1: pathname.append(sep) x = x + 1 print print pathname path_titles = ''.join(pathname)
citer is current iterator, which is like a cursor in sqlite to the current selected “Item”.
I can supply a patch or commit to git if needed.
Personally I think showing the path in the head label over the TextView is an option which could be toggled. Another good option is, like you suggested, in the node properties dialog.
Atm I work on Drag and Drop to implement dropping nodes internally and externally.
Cass aka. Acry20 October 2018 at 14:53 #125018
Sorry, the Code was not correct the val is taken of “column” 2 as the Treestore Row is defined as:
The correct and more readable Version of the Code is:
path = self.treestore.get_path(self.curr_tree_iter) count = len(path) path_span = 1 seperator = " >> " current_title = "" pathnames =  for pathes in path: if path_span == 0: curr_tree_iter = self.treestore.get_iter(path) else: curr_tree_iter = self.treestore.get_iter(path[0:path_span]) current_title = self.treestore.get_value(curr_tree_iter, 1) pathnames.append(current_title) if count > 1 and path_span < count: pathnames.append(seperator) path_span = path_span + 1 path_titles = ''.join(pathnames) #print path_titles
You must be logged in to reply to this topic.