Re: Number of rows in a Gtk::ListStore size?



On Sun, 2008-02-24 at 16:50 +0100, Andreas Volz wrote:
> Am Sat, 23 Feb 2008 12:53:53 +0100 schrieb Simon Fuhrmann:
> 
> > Use liststore->erase(liststore->children().end())
> 
> The hint was good, but I got a segfault. It worked that way:
> 
>     Gtk::TreeIter treeIt = m_refListModel->children ().end ();
>     --treeIt; 
> 
>     m_refListModel->erase (treeIt);
> 
> The last element is the one before end() as in the STL containers. :-)
> 
> This may be dangerous, but works because I'm sure that list size is
> never zero.

alternatively, you might be able to use rbegin()
-- 
Jonner



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