Re: XForms: drag and drop, but different

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 10 Jul 98 20:11:26 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> 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 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).

Creating a Pixmap cursor will probably not do what you what. Pixmap
cursors are generally limited to fairly small Pixmaps -- often 32x32
or less.

What you might do is to create a Window the size of the object you
want to drag, do an XCopyArea() of the data into it, and then drag it.

As long as the CPU and server are able to keep up with the drag, which
is probably the case in all but the clunkiest old dog systems (such as
some of the ones in our lab :-)), and you don't try to make too large
of a Window, you'll probably win.

spl
_________________________________________________
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/