Re: [gtkmm] iterator on ListStore rows ?



On Wed, 2004-06-30 at 17:38 +0200, cedric wrote:
> Hello!
> 
> sorry to bother you once more time, but i must be bad...
> i want to get an iterator on the rows of a ListStore that starts on the 
> first row of the ListStore.
> so i tried to use Gtk::TreeModel method, get_iter(Glib::ustring path) 
> but i get a seg fault :(

I guess that you want to use TreeModel::children().begin() and end().
This should be familiar to you from the rest of the C++ standard
library.

> it s probably because my string path was not correct (i ve put "0"), so 
> i tried to see the correct representation using a method from 
> Gtk::TreePath, to_string(Gtk::TreePath path) that returns the string 
> path. and it returns... "0" !?!
> so is there a secret hint or what???
> 
> here is the procedure connected with the row selection signal handler:
> m_refListModel is a Glib::RefPtr<Gtk::TreeModel>
> ============================================================================================================
> void EstimatesPage::on_estimate_selected(const Gtk::TreeModel::Path 
> &path, Gtk::TreeViewColumn *column )
> {
>     Glib::ustring s = path.to_string();
>     Gtk::TreeModel::iterator iter = m_refListModel->get_iter(s); //this 
> line provoques the seg fault
>     std::cout << s << std::endl;
> }
> ============================================================================================================
> 
> i know i could get my iterator by "prepending" then deleting a row in my 
> ListStore but that wouldn t be clean, and i m sure there is a "normal" 
> way to do it!!!
> 
> tahnks for your help!
> best regards,
> cedric
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list




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