Re: EuGTK:TreeViiew Parents & Children

new topic     » goto parent     » topic index » view thread      » older message » newer message

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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu