
========================================================================
  Differences in VERSION 1.1:
   - compatible with Tk version 3.0
   - added "drag&drop active" command
   - send command now automatically gets three arguments (interp name,
      drag&drop target widget name, and result from token command)
      instead of two.
   - result from token command now can be used to pass drag&drop value
      to send command.
   - added -rejectbg and -rejectstipple to enhance drawing of rejection
      symbol on token window.
   - changed default -button for source windows to "3" instead of "1".
========================================================================

------------------------------------------------------------------------
  Version 1.1 of the drag&drop facility has been made available for
  anonymous ftp:
   
      SOURCE: barkley.berkeley.edu [128.32.142.237]
        FILE: pub/tcl/extensions/dragdrop-1.1.tar.Z

  This version should be used with Tk version 3.0.
  Please send comments or suggestions to michael.mclennan@att.com.
------------------------------------------------------------------------

========================================================================
                Copyright 1992 by AT&T Bell Laboratories
========================================================================
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that the copyright notice and warranty disclaimer appear in
supporting documentation, and that the names of AT&T Bell Laboratories
any of their entities not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.

AT&T disclaims all warranties with regard to this software, including
all implied warranties of merchantability and fitness.  In no event
shall AT&T be liable for any special, indirect or consequential
damages or any damages whatsoever resulting from loss of use, data or
profits, whether in an action of contract, negligence or other
tortuous action, arising out of or in connection with the use or
performance of this software.
========================================================================


Implementation Notes:

This drag&drop facility provides a graphical paradigm for coordinating
"send" commands between related TCL/Tk applications.  It was written
to operate in the spirit of TCL/Tk, and not necessarily to imitate
other drag-and-drop protocols.


GETTING THE DISTRIBUTION:

 - FTP the distribution from barkley.berkeley.edu:

     ftp barkley.berkeley.edu
     cd
     binary
     get dragdrop-1.1.tar.Z
     quit

 - untar the distribution file:

     zcat dragdrop-1.1.tar.Z | tar -xvf -

This will create a directory "dragdrop-1.1" with the subdirectory
"demos".


MAKING A NEW WISH:

Update the first few lines of the given Makefile to use the proper
paths for your local installation of TCL/Tk.  Note that the Makefile
references the source directories for TCL/Tk, as well as the usual
libraries.  Build a new wish (called "dish" to avoid any conflict
with your usual wish) that will contain the drag&drop facility:

    make


UPDATING YOUR APPLICATION:

To add this facility to your application, simply add the following
command when initializing new interpreters:

    extern void Tk_AddDragDropCmd
        _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin));

    main(argc,argv)
        int argc;
        char **argv;
    {
        Tcl_Interp *interp;  /* main interpreter */
        Tk_Window w;         /* main application window */

        interp = Tcl_CreateInterp();
            .
            .  usual set-up stuff
            .
        w = Tk_CreateMainWindow(interp, display, name);
            .
            .  usual set-up stuff
            .
        Tk_AddDragDropCmd(interp,w);

            .
            .  finish set-up and enter main loop
            .
    }

The usual "main.c" file used for wish has been updated with these
changes, and is included in this distribution.


RUNNING THE DEMO:

The "palette" demo provided in the "demos" directory illustrates the
basic concepts of the drag&drop facility.  You may drag and drop
between the widgets of a single application, or between multiple
palette applications.  Once you have created the "dish" application
which recognizes the drag&drop command, you can invoke the palette
application as:

    dish -f demos/palette

This brings up a window with three sliders controlling the RGB values
of a sample color; as you move the sliders, the color sample changes.

  - If you click with the third mouse button on one of the sliders,
    a token window with the numerical value of the slider will appear.
    This token window can then be "dropped" on another slider (or on
    the color sample next to the slider) to change its value.

  - If you click with the third mouse button on the color sample, a
    token window with the color value will appear.  This color can
    be dropped on the "Foreground" and "Background" targets to change
    the color scheme for the entire application.  It can also be
    dropped on the color sample in another application to transfer
    the RGB values.  Finally, it can be dropped on a slider (or on
    the color sample next to the slider); in this case, the appropriate
    color component (red, green, or blue) is extracted from the color
    and used to set the slider value.

  - If you try to drop a number value (from the slider) on the
    "Foreground" or "Background" targets, it will be rejected.

Notice that a particular widget can be configured to handle more than
one kind of data.  For instance, the slider (and its associated
color sample) will accept either a number value or a color value.

Notice also that a single kind of data can be handled differently by
different targets.  A single mechanism is used to transmit RGB color
values, for example, but the "Foreground" and "Background" targets
do very different things with the data.

Please experiment with this facility and send me your comments.

--Michael
------------------------------------------------------------------------
