Re: TreeView - First element



Hi,

Am Sonntag, den 03.01.2010, 10:53 +0800 schrieb smso graduate hku hk:
> My suggestion:
> 
> 	Gtk::TreeIter iter_selected = view->get_selection()->get_selected();
> 	if (!iter_selected)
> 		return;
> 
> 	// find index:
> 	Gtk::TreePath path = model->get_path(iter_selected);
> 	int index_selected = path[0];
> 	int max_index = model->children().size() - 1;
> 	if (index_selected == max_index) // only 1 row in model!
> 		return;
[snip]

Ouch, that's convoluted.  What Adam was trying to do was in principle
correct.  It would be cool if someone who has the time to do so could
look over his test case to check whether he made some subtle mistake, or
if there is a problem in gtkmm.

Let's try to avoid suggesting work-arounds until we figured out what the
problem is.

--Daniel




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