Re: TreeView - First element



Hi,

Am Freitag, den 01.01.2010, 20:59 +0100 schrieb Adam Chyła:

> if (ListTreeModel->children().begin() != iter)
> ListTreeModel->iter_swap(iter, iter--); // But if iter is the first
> element from the list the code isn't work properly

Please define "code isn't working properly" in more detail.

One a side note, your code is relying on sequence point rules in a very
peculiar manner.  You do not actually violate any sequence point rule,
since the iterator arguments are passed by reference to iter_swap() and
there is a sequence point before every function call.  So what your code
does is basically the same as

  Gtk::TreeModel::iterator prev = iter;
  ListTreeModel->iter_swap(--prev, iter);
  iter = prev;

Don't know if this was intentional.  Anyway, it's probably unrelated to
the problem you were asking about.  It's hard to tell though since you
didn't say what the problem actually is.

--Daniel




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