GtkCombo drag-and-drop



Hi!

I'm trying to implement drag-and-drop on GtkCombo items. Here's the
setup:

GtkCombo
  GtkList
    GtkItem <- Is both drag source and drag destination
      GtkTable
        various widgets

I have only one signal: drag_drop, because all I want to do is swap the
contents of two items in the list, when one item is "dropped" onto
another.

However, the signal never ends up getting called, and/because I get the
following in the terminal:

(dnd:18637): Gtk-CRITICAL **: file gtkwidget.c: line 6023
(gtk_widget_is_ancestor): assertion `GTK_IS_WIDGET (widget)' failed

If I set up the application exactly the same way but use a GtkList
instead of a GtkCombo, everything works fine.  That is, instead of

cb = gtk_combo_new () ;
lst = GTK_COMBO (cb)->list ;
gtk_container_add (wnd, cb) ;

I write

lst = gtk_list_new () ;
gtk_container_add (wnd, lst) ;

and all of a sudden those messages go away, my callback gets executed,
and all is well.

To illustrate, please consider the attached piece of code.

In the attachment, merely comment out the line that reads

#define USE_COMBO

to switch from a GtkCombo to a GtkList.

Please let me know - I appreciate any help I can get.

TIA


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