TreeModelFilter + drag and drop
- From: Yann Leboulanger <asterix lagaule org>
- To: gtk-list gnome org
- Subject: TreeModelFilter + drag and drop
- Date: Sat, 17 Nov 2007 22:54:45 +0100
Hi again,
I'd like to use Drag and drop on a treeview that gets data in a
TreeModelFilter. Of course at the begining I got this error:
GtkWarning: You must override the default 'drag_drop' 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_drop' 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.
So what I understood is that I had to write a drag_drop handler and put
my code there instead of in the drag_data_received handler and finish by
stopping the propagation of the event. Am I right?
If so, the problem is that drag_drop handler don't get selection_data
and info parameters. Is there a way to get them? For selection_data this
can be a global variable, but for info, I don't see how to know if the
drop happend on a row, between 2 rows ...
Thanks for helping me,
--
Yann
PS: My code is in pygtk, but behaviour is probably the same than in C
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]