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

Re: GtkTreeView and the arrow to expand rows



On Tue, Jul 29, 2003 at 04:48:55PM -0400, Richard Baverstock wrote:

> Is there a way to set a row in a GtkTreeView to have the "expandable"
> arrow by default (despite not having any children)? The idea being when
> the expand arrow is clicked, the program appends child rows and adds the
> data to be displayed. This obviously can't happen without the arrow
> already being there, unless you do it based on selection, but then you
> end up having to click the row (in order to get the arrow), then click
> the arrow to expand.

Not unless you create a custom TreeModel, or override some of the methods of
TreeStore (obviously easier in one of the OOPL bindings).

However, a simple way to do it is to append some marker row to those rows
that will have children.  I append a row with a particular numeric marker
column set to -1.  Then I catch the "expand-row" signal, check for my
marker, and then append the children if appropriate.

Dave Cook



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