This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
Re: implementing guile-gtk drag & drop...
Daniel Skarda <0rfelyus@ucw.cz> writes:
> > Using gtk_selection_data_copy/free seems to be the right thing to do.
> > Can you figure out why they made drag and drop fail? Maybe there are
> > bugs in those functions that we can work around.
>
> Unfortunately Gtk creates GtkSelectionData, invokes a handler and
> expects that you gtk_selection_data_set on data that Gtk passed to
> handler, not to its copy :-( See gtkselection.c.
Aha. So gtk_selection_data_copy is useless and GtkSelectionData
should really be using reference counting, right?
In that case, we need a new kind of life-time management option in
guile-gtk: the Scheme value that represents a GtkSelectionData needs
to be invalidated when the real GtkSelectionData is freed.
We don't have such a mechanism currently, but it should not be that
difficult to add it. Basically, sgtk_callback_marshal would need to
'destroy' the arguments of the callback when it has returned.
Any takers?
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405