Version 9 of TkDND

Updated 2009-10-16 10:39:46 by Googie

What: tkdnd

 Where: http://www.sourceforge.net/projects/tkdnd/ 
        http://www.iit.demokritos.gr/%7Epetasis/Tcl 
        http://www.ellogon.org/petasis/index.php?option=com_docman&task=doc_download&gid=57&Itemid=37
 Description: Tk drag and drop interface using XDND as the protocol under Unix and OLE dnd under windows.
        Was previously maintained at the Tcl core's NetCVS repository,
        but is now hosted on SourceForge.
        Requires Tk 8.3.3 .
        Currently at version 2.0 alpha 6 - be aware that on windows, the 
        functionality is there, but little documentation. On unix, however,
        the drag functionality is still missing.
 Updated: 02/2007
 Contact: mailing lists.

03/2004: Binary rpm packages for Linux available: http://sourceforge.net/project/showfiles.php?group_id=13167&package_id=89951

14/03/2007 I have downloaded tkdnd2.0 and it works; however no instructions are given on installing the files, or which files will be needed for a redistribution of tkdnd. Here are my instructions GWM. I have also had the temerity to remove the text NEW! from the above rpm announcement.

Method (i) place the entire tkdnd2.0 directory in your /tcl/library directory. This is OK for personal use but if you are delivering an application using DND then what files do you need to package up? See:

Method (ii) make a new directory anywhere, but a sensible choice is in the directory where your main program/script resides. Copy the libtkdnd20 (dll,so) the library directory (which contains 4 tcl files) and the pkgIndex.tcl to this directory. Add the new directory to auto_path in your application, call 'package require tkdnd' and use it. Example:

  lappend auto_path [file join .. "dont just copy this example directory" tkdnd] ;# where dll/so are
  package require tkdnd
  pack [label .drop -text "drop files, text here"]  ;# make a drop target
  tkdnd::drop_target register .drop *
  bind .drop <<Drop>> "tk_messageBox -message \"you dropped %D\"" ;# what to do on drop

NB you can drop files from windows, or highlight some text (eg in this page) and drag it onto the drop target. What you do in response to the drop is your affair. The manual supplied does tell you how to restrict the types of drop, what events can occur and how to create a drag source.


16/10/2009 - Googie: I've just tried to compile alpha6 and during configuration I get:

  checking for Tk private include files... configure: error: Cannot find private header tkInt.h in /home/andreask/dbn/lba/night/builds/linux-x86_64/tk.inst

After making workaround (manually edited configuration script) the unix C implementation misses limits.h header for MAX_LONG, just FYI.