Re: TreeModel::Iterator invalid



No I'm Not. The function that contains the code is connected to the signal from a GTK Button that is on the form.

John

On 22/12/06, Paul Davis <pjdavis engineering uiowa edu> wrote:
John,

You're not by chance accessing these iterators in a
TreeSelection::get_selected() callback are you?

Paul

On 12/22/06, John Blackburn <johnmblackburn googlemail com > wrote:
> Paul,
>
> Unfortunately not, for two reasons: firstly, the same problem persists where
> the iterator becomes invalid and secondly, the Operator ++ is not defined
> for column values.  Clearly the second problem is minor but the main problem
> is a real show stopper.
>
> I am trying to use the iterators in an STL like way; however, unlike STL
> iterators, whenever I try to modify the value of any column, immediately all
> iterators are destroyed.
>
> There must be a way of getting round this or it would have been a real issue
> for gtkmm programmers but I havn't seen it yet.
>
> Thanks for your help
>
> John
>
>
> On 20/12/06, Paul Davis <pjdavis engineering uiowa edu> wrote:
> > John,
> >
> > This doesn't work?
> >
> > Gtk::TreeModel::Row row = (*iter) ;
> > row[m_Columns->m_value]++ ;
> >
> > Paul
> >
> > On 12/20/06, johnmb <johnmblackburn googlemail com> wrote:
> > >
> > > I am trying to use the following line of code to increment the value of
> a
> > > column.
> > >
> > >         (*item_iter)[m_Columns->m_value] =
> (*item_iter)[m_Columns->m_value]
> > > + 1;
> > >
> > >    item_iter  is an iter and m_Columns is a set of columns in the
> TreeModel.
> > >
> > > My probelm is that his works on the first occasion and then the iter
> becomes
> > > invalid.  What code do I need to use to make the iter persist ?
> > >
> > > --
> > > View this message in context:
> http://www.nabble.com/TreeModel%3A%3AIterator-invalid-tf2860248.html#a7991457
> > > Sent from the Gtkmm mailing list archive at Nabble.com.
> > >
> > > _______________________________________________
> > > 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]