Re: GTK+2 - GtkTreeModel



Shane Butler <shane_b operamail com> writes:
> 
> Just wondering if someone could suggest the best way to move a row in a
> GtkTreeModel up or down. 
> 

The GtkTreeModel interface is read-only; you have to use the specific
subclass of GtkTreeModel to modify things.

So for example with GtkListStore you could move a row up by removing
it then reinserting it, or by swapping the contents of a row and the
row above it, whatever is convenient for your app. I usually have a
list store with a single column containing an object or struct, so I
would just call list_store_set() a couple times to swap the row
contents.

Havoc



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