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



Am Sun, 24 Feb 2008 10:40:08 -0600 schrieb Jonathon Jongsma:

> 
> 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()

AppToolBox.cpp:98: error: no matching function for call to
'Gtk::ListStore::erase(std::reverse_iterator<Gtk::TreeIter>)' 
/usr/include/gtkmm-2.4/gtkmm/liststore.h:133:
note: candidates are: Gtk::TreeIter Gtk::ListStore::erase(const
Gtk::TreeIter&)

regards
Andreas


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