Re: [gtk-list] Re: GtkList, dragging a row to a new position.



Note that Anders is talking about GtkCList whereas Steve asked about
GtkList. I don't know if there's a way to do this in GtkList (but I doubt
it).

John


on 1/6/00 3:20 PM, Anders Melchiorsen at and@kampsax.dtu.dk wrote:

> Steve Ramsay <ramsay@universal.ca> wrote:
> 
>> Is it possable to select a row in a GtkList and drag it to a new
>> position within the list?  And if so does anyone have a sample or
>> some pointers on how to go about doing this?
> 
> 
> GTK+ can handle that all by itself, if you activate it:
> 
> gtk_clist_set_reorderable(clist, true);
> 
> 
> However, if you want to do something when the rows are moved around
> (like updating data structures depending on the order of the GTK+
> list), you need to connect to the row_move signal:
> 
> gtk_signal_connect_after(GTK_OBJECT(clist), "row_move",
> GTK_SIGNAL_FUNC(RowMove), user_data);
> 
> and have a call-back function:
> 
> void RowMove(GtkCList* clist, int from, int to)
> {
> // The CList had a row moved from line "from" into line "to"
> 
> 
> // ...Do something...
> }
> 
> 
> Good luck!



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