I'm supposing you understand what ``drag and drop'' means. It's an intuitive way to exchange data between programs. A drag and drop protocol is the mean used by the programs to comunicate with each other in order to perform this data exchange. If the programs want to exchange information, they must be able to comunicate with each other in a common language. This language is the ``protocol''. Therefore, if you create your own protocol, chances are other programs will not understand you. So you must ``talk'' to other programs in a common language. In this way, when you receive a drop, you will receive a ``I dropped on you'' message, and you will understand the message no matter who send it to you. This is the purpose of a drag and drop protocol: to provide a common language for this kind of actions.
DND is a drag and drop protocol developed by
César Crusius
. A C
interface to
Xt-based programs is avaliable together with OffiX, a collection of useful
utilities using the DND protocol.
If you have a program that could benefit from having drag and drop capabilities, DND might be a good choice for the following reasons:
C
Xt interface is provided, so you can add drag and drop
capabilities to an existing Xt program with a minimum effort.Of course, there are also reasons to not use DND:
I encourage you to use DND at least as a compile-time option for your program. There is already a good reason to do that: the ``files'' program furnished with OffiX. Won't it be good to be able to exchange data with a file manager? Certainly will! And, as you will note, it's very easy to bring this new capability to your program.
In the actual stage you can only get the Xt interface for DND. If you want to use DND in non-Xt applications, you must write some code. It is not a difficult task to do so (see section The DND internals ).
The best way to install the DND Xt interface library is the following:
Imake.options
to suit your
needs. If you don't want any OffiX utility installed, don't compile the
OffiX modules (remove all from OFFIX_MODULES
option).xmkmf ; make Makefiles ; make
make install
make install.man
Now you should have the static DND library and the necessary header files
installed on your system. If you are not root and want to compile your program
with DND, just copy the files DragAndDrop.c
and the DND header files from
the OffiX directory and compile and link them with your program.
There seems to be a strange behaviour when DND programs run under OpenWindows, at least under the version I have in my work. With FVWM there are no problems reported yet. If you run DND programs under another window manager, please send me a note telling about the results.
Next Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter