4

Here Is it possible to use arrow keys alone to expand tree node in package explorer in Eclipse on Linux? I've found good idea to change behavior of treeview in eclipse. I'd like to improve it, but I'm don't know how to do, because i cant found example of using if-then-else statement in gtk.css configuration file.

I've found the couple of methods "test-collapse-row" and "test-expand-row" in ref below https://developer.gnome.org/gtk3/stable/GtkTreeView.html#GtkTreeView-select-cursor-row to test current line on expandable it or not. I've tried to find an example with condition for css key bindings but yet not found.

@binding-set MyTreeViewBinding
{
   bind "Left"     { "select-cursor-parent" ()
                  "expand-collapse-cursor-row" (0,0,0) };
   /* I've try code below instead code above - isn't work
   bind "Left"     { if ("test-expand-row" ()) 
                         "expand-collapse-cursor-row" (0,0,0) 
                     else 
                         "select-cursor-parent" () }; */
   bind "Right"    { "expand-collapse-cursor-row" (0,1,0) };
}

treeview
{
   -gtk-key-bindings: MyTreeViewBinding;
}

I need if it node, and it not collapsed collapse it, but if it not node or it already collapsed set up pointer to parent, but don't collapse it.

  • Ever found the solution to the problem? – joker Feb 24 '20 at 13:48
  • I found a work around to do the same thing. Please find my answer here: https://stackoverflow.com/a/60376697/1051589 – joker Feb 24 '20 at 14:13
  • Oh, thank You, but its a little bit different as i'd like to have. This way is known, so i'd like to realize this algorithm other way. So it realized in Eclipse for Windows. Look carefully if the node is closed, the left pressing is open it, but if node is already opened the left pressing moving the pointer to parent. Without "Shift" pressing. – Evgeniy Chekushkin Feb 25 '20 at 20:53
  • Yes. You are right. This is the closest I was able to go, though. I totally understand what you're trying to do, but couldn't do exactly that. This is best solution I was able to come up with. – joker Feb 26 '20 at 10:26

0 Answers0