DND with a TreeModelFilter



Hi,

What's the best way to get drag and drop working with a filtered tree
view? I have a TreeModelFilter that sits on top of a TreeStore.

I tried deriving a new model from TreeModelFilter, TreeDragDest and
TreeDragSource, implementing the virtual functions in the latter two,
but that did not work -- the virtual functions were never called and I
got the GTK assertion below:

"Gtk-WARNING **:You must override the default 'drag_data_received' 
handler on GtkTreeView when using models that don't support the
GtkTreeDragDest interface and enabling drag-and-drop. The simplest way
to do this is to connect to 'drag_data_received' and call
g_signal_stop_emission_by_name() in your signal handler to prevent the
default handler from running. Look at the source code for the default
handler in gtktreeview.c to get an idea what your handler should do.
(gtktreeview.c is in the GTK source code.) If you're using GTK from a
language other than C, there may be a more natural way to override
default handlers, e.g.  via derivation."

Connecting to the signal_drag_data_received() did not make a difference.

I dabbled around with the DND API exposed by Widget as well as deriving
from TreeView and implementing on_drag_data_received() there but
I couldn't really get that to work either.

I would be grateful if anyone could point me in the right direction!

/Staffan

Attachment: signature.asc
Description: This is a digitally signed message part



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