Re: GtkTreeView question.



On Sat, 2002-06-15 at 16:31, Nils O. Selåsdal wrote:
> Hi, at my treeview I need to be able to expand nodes even if they
> dont have any childreen(I''ll get the row-expanded signal and insert
> them there). However if a node dont have any childreen the user wont be
> able to expand it. How to tell my treeview/model that a node should be
> expandable even if it doesnt have any child nodes?

I had the same problem and solved it in the following way:
For each node that needs expander but have no real data in its brach I
create a fake row that contains no data. When this row is not expanded
user doesn't see this anyway. When it needs to be expanded I quickly
remove this fake row and add real data and then expand the tree. I had
some problems with Gtk+ that crashed when I messed with model's data in
some signal handlers, but finally I've managed to do it. Unfortunatelly
I'm using Gtkmm so I don't think my code would be an usable example for
you.

-- 
struct Sig {
  string name("     J a r e k   D u k a t     ");
  string mail(" madmaxer (at) poczta (dot) fm ");
};


-----------------------------------------------------------------------
INTERIA.PL: Portal pelen informacji... >>> http://link.interia.pl/f15ed





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