XForms: drag and drop, but different

Paul Barton-Davis (pbd@Op.Net)
Fri, 10 Jul 1998 22:34:03 -0400

# To subscribers of the xforms list from Paul Barton-Davis <pbd@Op.Net> :

I've been trying to implement a form of drag-and-drop in an on-and-off
way for a couple of months. What I actually wanted was something
similar to what the Macintosh Finder does when you select a bunch of
files, and lets you drag an outline of all their icons (or maybe its
just their names in a bounding box.

I have a multi-selectable browser object, and a post-handler set up
that lets me "drag" all the selected items into another browser
object. I came up with a hack to get around my lack of knowledge (see
next paragraph) of how to display the "dragging selected items" which
is to create a new browser object with just those items set, and use
the post-handler to allow this new browser to get dragged. This all
works perfectly from a functional point of view, but visually its
horrendous: each move the "dragging browser" makes causes a redraw of
every object on the form.

I think there is a better way, but I don't know enough about raw X
programming to know how to do what I think needs to be done: to create
a new pixmap cursor reflecting the selected items, so that I can set
the window cursor, and drag using this cursor until I'm ready to reset
it (i.e. do the drop or cancel it).

It seems like I need to do something akin to XCopyArea but into a
pixmap that I can then use in XCreatePixmapCursor. I simply don't know
how to do this, and it maybe that there is a much better way. If this
sounds about right, I can fool around with any suitable X calls to get
it perfect, but I'd be happy to accept alternative suggestions as
well.

--p

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/