Re: EuGTK:TreeViiew Parents & Children
- Posted by irv Aug 23, 2019
- 790 views
EuGTK has a way to work around that: tested on Windows10
---------------------------------- global function ShowSelection() -- ---------------------------------- atom iter = allocate(32), model = allocate(32), parent = allocate(32) object result if gtk_func("gtk_tree_selection_get_selected",{P,P,P},{selection,model,iter}) then result = get(store,"value",iter,1) display(result) -- just shows clicked item; while gtk_func("gtk_tree_model_iter_parent",{P,P,P},{store,parent,iter}) do result = get(store,"value",parent,1) & " -> " & result iter = gtk_func("gtk_tree_iter_copy",{P},{parent}) end while -- look up parents; display(result) -- or, Info(,,result) if you prefer; -- show full path to clicked item; -- e.g: Mac -> The Woz -> Billy (the kid) -> Fido end if return 1 end function
I suppose it would be 'nice' to have this as a function call in EuGTK, but so seldom used, it's probably not a big deal.