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

fpiraneo fpiraneo at iface.ch
Thu May 20 09:09:18 EDT 2010

Hi Chris,

thank you for your answer!

Christopher David Howie wrote:
> 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.

Yes... I did it but this is the result:

" Gtk-CRITICAL **: gtk_list_store_move_after: assertion `VALID_ITER
(position, store)' failed"

The source iter is valid...

Christopher David Howie wrote:
>> 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.

I'll try and I'll let you know!

View this message in context: http://mono.1490590.n4.nabble.com/On-a-ListStore-moving-items-on-the-list-some-questions-tp2222829p2224504.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.

More information about the Gtk-sharp-list mailing list