[Gtk-sharp-list] On a ListStore moving items on the list... some questions!

Christopher David Howie me at chrishowie.com
Wed May 19 12:43:05 EDT 2010

On 05/19/2010 09:29 AM, fpiraneo wrote:
> 1. on the documents above it's written: "If position is null, iter will be
> moved to point to the end of the list" but if i use such writings:
> "lsPagesSelected.MoveAfter(stIter, null );" the program won't compile; same
> result when casting the "null";

The documentation should be corrected.  Since TreeIter is a struct, null
cannot be converted to TreeIter.  Use TreeIter.Zero instead.

> 2. no problem on moving an item down the list with the "MoveAfter" and
> assigning the "position" parameter to the iter calculated with the
> "IterNext"; any suggestion to easily calculate the equivalence of
> "IterBefore" (to moving an item up the list).

The most efficient way will probably be to get the path of the iter,
subtract 1 from the last component, then turn that path back into an
iter.  Not exactly clean, but I can't think of a better way to do it.

Chris Howie

If you correspond with me on a regular basis, please read this document:

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.

More information about the Gtk-sharp-list mailing list