Drag & Drop on GTK 1.3 (win32)
- From: Gabriele Greco <gabriele greco darts it>
- To: gtk-app-devel-list gnome org
- Subject: Drag & Drop on GTK 1.3 (win32)
- Date: Thu, 26 Jun 2003 16:40:14 +0200
Just wondering if I have something special to do to make DnD work in a
reliable way in GTK 1.3 (2003/15/5) on the Win32 platform.
It seems that the "drag_data_received" signal is not dispatched on
CLists & Trees of the same application (while it's received if I drag a
file from windows explorer to the clist), at least it works partially
and not in every situation... It seems that also the "drag_motion"
signal is sent only once while on Linux it seems to be sent every time
the mouse is moved, I'm using the precompiled binaries, but I've seen in
the w32 sources that there is an OLE2_DND symbol that can be defined and
a gdk_dnd_init() call that gtk doesn't call anywhere, I've googled the
net and found a few persons with similar problems... Just wondering if
there is a way to make DnD work consistently both with Linux and Win32,
maybe I do the signal ad source/target initializations in a wrong way
compatible only with linux....
Example for a clist (w), but the sequence is the same for all my lists:
enum { TARGET_STRING, TARGET_ROOTWIN, TARGET_URL };
static GtkTargetEntry target_entry[] = {
{"STRING", 0, TARGET_STRING},
{"text/plain", 0, TARGET_STRING},
{"text/uri-list", 0, TARGET_URL}
};
gtk_drag_dest_set(
w, GTK_DEST_DEFAULT_ALL, target_entry,
sizeof(target_entry) / sizeof(GtkTargetEntry),
(GdkDragAction)(GDK_ACTION_MOVE | GDK_ACTION_COPY) );
gtk_signal_connect(GTK_OBJECT(w), "drag_motion",
GTK_SIGNAL_FUNC(motioncbk),
user_data);
gtk_signal_connect(GTK_OBJECT(w), "drag_data_received",
GTK_SIGNAL_FUNC(receivedcbk), user_data );
gtk_signal_connect(GTK_OBJECT(w), "drag_drop",
GTK_SIGNAL_FUNC(okdropcbk), user_data );
gtk_drag_source_set(
w, (GdkModifierType)(GDK_BUTTON1_MASK |
GDK_BUTTON2_MASK), target_entry,
sizeof(target_entry) / sizeof(GtkTargetEntry),
(GdkDragAction)(GDK_ACTION_MOVE | GDK_ACTION_COPY ) );
gtk_signal_connect( GTK_OBJECT(w), "drag_data_get",
GTK_SIGNAL_FUNC(DNDDataRequestCB),
user_data );
receivedcbk and okdropcbk are never called on Win32, while motioncbk is
called only once but while the source widget is still the same as the
target.
Thanks in advance,
Gabry
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]