Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!ncar!gatech!uflorida!mlb.semi.harris.com!trantor.harris-atd.com!trantor!chuck From: chuck@trantor.harris-atd.com (Chuck Musciano) Newsgroups: comp.windows.open-look Subject: Initiating drag and drop Message-ID: <4861@trantor.harris-atd.com> Date: 13 Nov 90 21:32:09 GMT Sender: news@trantor.harris-atd.com Reply-To: chuck@trantor.harris-atd.com (Chuck Musciano) Organization: Advanced Technology Dept, Harris Corp, Melbourne, FL Lines: 66 I am trying to initiate a drag and drop operation from an XView tool. I successfully create a cursor and get a fullscreen, and drag the cursor to another window. When I release the mouse button, my code sends a message to the XV_POINTER_WINDOW under the mouse. Here's the problem. If the receiver is filemgr, the message is received, and the file is copied. Any other tool, like textedit, ignores the message. Even my tool, which can receive ACTION_DRAG_LOAD events, doesn't get the message. Why is it that messages from filemgr are received, but messages from me are not? To further mystify matters, if I open a textedit window by double-clicking a file in filemgr, and then drop something in that textedit window from my tool, the message is received by filemgr! Could it be that receiving a DRAG event is an XView-level thing, while sending a DRAG event is an X-level thing, and that tools need to be set to receive both XView-level DRAG and X-level DRAG? My tool receives XView-level stuff as described in the XView Programmer's Guide. How do I set it to receive the equivalent X-level DRAG events? Here is my code, taken from a sample included with GUIDE. Any suggestions are appreciated. Is this covered in any reference guide? There is plenty on receiving a DRAG event, but nothing on starting one. typedef struct {XID xid; int x; int y; Window window; Atom property; } Drag_message; Xv_window dest_win; Fullscreen fullscreen; int xdrop, ydrop; Window source_xid, dest_xid; Atom drag_atom; Drag_message msg; /* setting up fullscreen stuff removed for clarity */ source_xid = (Window) xv_get(source_window, XV_XID); drag_atom = XInternAtom(display, "DRAG_DROP", FALSE); XChangeProperty(display, source_xid, drag_atom, XA_STRING, 8, PropModeReplace, path, strlen(path) + 1); msg.xid = XV_POINTER_WINDOW; msg.x = xdrop; msg.y = ydrop; msg.window = source_xid; msg.property = drag_atom; xv_send_message(source_window, XV_POINTER_WINDOW, "XV_DO_DRAG_LOAD", 32, &msg, sizeof(msg)); -- Chuck Musciano ARPA : chuck@trantor.harris-atd.com Harris Corporation Usenet: ...!uunet!x102a!trantor!chuck PO Box 37, MS 3A/1912 AT&T : (407) 727-6131 Melbourne, FL 32902 FAX : (407) 729-2537 A good newspaper is never good enough, but a lousy newspaper is a joy forever. -- Garrison Keillor