Re: treeview drag-and-drop



On Sat, Sep 07, 2002 at 12:54:33PM +0200, Henrik Brix Andersen wrote:
Hello,

I am using the gtk2 treeview with a list store.

I have enabled reordering of the model using
gtk_tree_view_set_reorderable () and connected to the signal
"row-reordered" from the list store, but when I drag a row to a new
position within the treeview a "rows-reordered" signal is not emitted.


I've got the same problem.  Can anyone help?

My test code looks like:

/* Handle "rows_reordered" signal, indicating the rows in the clock have been
   moved */
void registerReorderedRows  (GtkTreeModel *clocklistModel,   
                                               GtkTreePath  *path,

GtkTreeIter  *iter,
                             gint         *new_order)
{
   printf("got rows_reordered signal\n");
}

int main( int argc, char *argv[] )
{
...
  clocklistModel = gtk_list_store_new (LIST_COLUMNS, 
                                        G_TYPE_STRING, /* TZ name */

                                        G_TYPE_STRING, /* TZ description */
                                        G_TYPE_STRING  /* time/date */
                                      );

  clocklist = gtk_tree_view_new_with_model (GTK_TREE_MODEL
  (clocklistModel));  
  gtk_tree_view_set_reorderable( GTK_TREE_VIEW(clocklist), TRUE );
  g_signal_connect(G_OBJECT(clocklistModel), "rows_reordered", 
  G_CALLBACK(registerReorderedRows), NULL);
...
}


When the program runs, the rows in the GtkTreeView can be reordered, but the
"got rows_reordered signal" message never appears on stdout.

What might be wrong?

Drew

-- 
PGP public key available at http://people.debian.org/~dparsons/drewskey.txt
Fingerprint: A110 EAE1 D7D2 8076 5FE0  EC0A B6CE 7041 6412 4E4A



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