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

Christopher David Howie me at chrishowie.com
Thu May 20 14:24:45 EDT 2010


On 05/20/2010 12:45 PM, fpiraneo wrote:
> I have a third question about these two functions: when I call the MoveAfter
> and MoveBefore, visually the items will be arranged accordingly in my
> treeview; now the question: these two functions alter also the order on the
> liststore or only the appearance of the items inside the treeview? I ask
> this because when I pick up the elements on my liststore it seems that the
> order I set up is completely forgot... the liststore is unsorted.

The store is the data model; the TreeView displays exactly what is in
the model.  So you are rearranging the rows in the store itself.

If you want to rearrange the order without reordering the rows in the
store then you need an intermediate model that will read from the store
and reorder the rows on-the-fly using some other data structure.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

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

------------------------------------------------------------------------
                    IMPORTANT INFORMATION/DISCLAIMER

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