Re: Treeview selections vanish when parent collapses

Hi Jeffrey,

On Jun 20, 2011, at 1:11 AM, Jeffrey Barish wrote:

> If you select children in a treeview and then collapse the parent, the 
> selections vanish.  So: select a child, collapse the parent, expand the 
> parent, the child is no longer selected.  That behavior seems wrong to me.  
> Should I file a bug, or is GTK designed to work this way?  The tutorial for 

The widget is designed to work like this, there is actually a long-standing enhancement bug about this issue:

It is a hard problem to solve, the data structure used internally in GtkTreeView can only keep track of nodes that are visible (i.e. expanded).  So the selection state of a collapsed node cannot be recorded in this data structure.  Changing this data structure is hard, because a lot of GtkTreeView code depends on the data structure to work this way (reference counting, height calculation, checking whether or not a node is expanded, etc.)

Additionally, I can expect there to be usability problems with storing selection of collapsed nodes, especially if a selection is hidden three levels deep and you attempt some operation on the set of selected nodes.

> GTK 1.2 says that the selection should remain, but that source is ancient 
> history.

That tutorial should be about a widget that predates GtkTreeView.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]