Re: Gtk 2.10 DnD Behaves differently then 2.8 DnD
- From: Colossus <colossus 3000 it>
- To: gtk-app-devel-list gnome org
- Subject: Re: Gtk 2.10 DnD Behaves differently then 2.8 DnD
- Date: Wed, 15 Nov 2006 12:01:58 +0100
Stephan Arts wrote:
Hi,
As a developer of Xarchiver i have a question about DnD with Gtk
2.8.20 vs Gtk 2.10.6, in our current SVN version the DnD works with
2.8.20, which means... when you drop a file on the treeview, it calls
the callback-mechanism to open it, or add it to the archive.
With Gtk 2.10.6 this does not work.
Just some more info about the matter. The signal "drag-data-received"
is connected to the mainwindow this way:
MainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_drag_dest_set (MainWindow,GTK_DEST_DEFAULT_ALL, drop_targets, 1,
GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK);
g_signal_connect (G_OBJECT (MainWindow), "drag-data-received",
G_CALLBACK (on_drag_data_received), NULL);
Then a notebook widget is added this way:
/* Create the notebook widget */
notebook = GTK_NOTEBOOK(gtk_notebook_new() );
gtk_box_pack_start (GTK_BOX(vbox_body), GTK_WIDGET(notebook),TRUE,TRUE,0);
gtk_notebook_set_tab_pos (notebook, GTK_POS_TOP);
gtk_notebook_set_scrollable (notebook, TRUE);
gtk_notebook_popup_enable (notebook);
gtk_widget_show (GTK_WIDGET(notebook));
g_signal_connect ((gpointer) notebook, "switch-page", G_CALLBACK
(xa_page_has_changed), NULL);
When a new page is added to the notebook I connect these signals for
drag and drop:
g_signal_connect (G_OBJECT (archive->treeview), "drag-begin",
G_CALLBACK (drag_begin), NULL);
g_signal_connect (G_OBJECT (archive->treeview),
"drag-data-get",G_CALLBACK (drag_data_get), NULL );
g_signal_connect (G_OBJECT (archive->treeview), "drag-end",
G_CALLBACK (drag_end), NULL);
Under gtk 2.8.20 the signal drag-data-received is emitted when the
notebook is empty (no pages) and when some pages are added to it.
Under gtk 2.10.6 the signal is not emitted at all in both cases.
What can I do to have to drop detected when the notebook has no pages
(my window app empty) and when it has some ones?
P.S. I even tried to connect the drag-data-received to the
archive->treeview as showed above but nothing to do; the signal
is not emitted anyway.
Giuseppe
--
Colossus
Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
Xscreencast, a DE independent desktop session recorder -
http://xscreencast.berlios.de
Cpsed, a Linux OpenGL 3D scene editor - http://cpsed.sourceforge.net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]