Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANNOUNCE: TkDND 2.5

170 views
Skip to first unread message

Georgios Petasis

unread,
Jun 19, 2012, 6:39:03 AM6/19/12
to
I am pleased to announce version 2.5 of the TkDND extension.

What is new in TkDND 2.5?
--------------------------------------------------

1) Improved support for accepting drops under Linux.

2) Added support for dragging under Linux.

3) Fixes for the CF_HDROP type under Windows.

4) A new cross-platform type (DND_Color) for transferring colors.
Currently available only under UNIX (XDND protocol).

This is the first TkDND 2.x release that has support for both dragging
and dropping under all 3 major operating systems (Windows, OS X, Linux).

A detailed change log can be found here:

http://tkdnd.svn.sourceforge.net/viewvc/tkdnd/trunk/Changelog?revision=78

What is TkDND?
--------------------------------------------------
TkDND is a binary extension for Tk, which adds native drag & drop
capabilities to the Tk toolkit. It can be used with any Tk version equal
or greater to 8.3.3 and currently only the UNIX (X-Windows), Microsoft
Windows (XP, Vista, 7) and OS X (Leopard) operating systems are
supported (Tk 8.6 is required for OS X).

The project home page, including documentation, examples and download
links, can be found at:

https://sourceforge.net/projects/tkdnd/

http://www.ellogon.org/petasis/tcltk-projects/tkdnd

How to get it?
--------------------------------------------------
TkDND can be downloaded from the following locations:

Sources:
http://sourceforge.net/projects/tkdnd/files/TkDND/TkDND%202.5/tkdnd2.5-src.tar.gz/download

Windows 32bit Binaries:
http://sourceforge.net/projects/tkdnd/files/Windows%20Binaries/TkDND%202.5/tkdnd2.5-win32-ix86.zip/download

Windows 64bit Binaries: -

Linux 32bit Binaries:
http://sourceforge.net/projects/tkdnd/files/Linux%20Binaries/TkDND%202.5/tkdnd2.5-linux-glibc2.15-ix86.tar.gz/download

Linux 64bit Binaries:
http://sourceforge.net/projects/tkdnd/files/Linux%20Binaries/TkDND%202.5/tkdnd2.5-linux-glibc2.15-x86_64.tar.gz/download

OS X 10.7.3 64bit Binaries: -

All files: https://sourceforge.net/projects/tkdnd/files/

George Petasis

Harald Oehlmann

unread,
Jun 20, 2012, 2:26:52 AM6/20/12
to
Congratulation for the great package.

> 2) Added support for dragging under Linux.
So you solved the issue that the tk core must be extended to deliver a
timestamp?

Congratulations,
Harald

George Petasis

unread,
Jun 20, 2012, 3:07:34 AM6/20/12
to
No, I have used a parallel implementation of getting the selection (not
without some minor problems). You may notice some timeouts (error
"selection owner didn't respond"). In most of the cases you can avoid
this by clicking in the Tk toplevel after the drop. But in some rare
cases you will have to repeat the drop.

I think that Tk in some cases gets "lazy" and my code does not receive
the X events it should. I don't know why this happens.

Finally, the code has been written after studying how Qt reads the
clipboard when a drop occurs, since Qt was the problem and its data need
to be fetched with a specific timestamp. GTK is not strict with respect
to the timestamp, and dropped data can be fetched with Tk selection
commands. But since I cannot know if the remote application is a GTK
one, the new code is used for getting all dropped data.

George

Googie

unread,
Jul 12, 2012, 2:03:53 PM7/12/12
to
Hello George,

First of all let me say that this is an outstanding job you're doing here!
Unfortunately I could not get it working on my Linux (KDE 4.8.2, Qt 4.8.1). I tested it with very simple script:

package require tkdnd
tkdnd::drop_target register . DND_Files
bind . <<Drop>> {puts %D; list copy}

and after dropping a file I had to wait for couple of seconds, when an error appeared:

selection owner didn't respond
selection owner didn't respond
while executing
"_selection_get -displayof $_drop_target -selection XdndSelection -type $type -time $time"
(procedure "_GetDroppedData" line 28)
invoked from within
"_GetDroppedData $time"
(procedure "tkdnd::xdnd::_HandleXdndDrop" line 24)
invoked from within
"tkdnd::xdnd::_HandleXdndDrop 768526336"

Then I tried with DND_Text:

package require tkdnd
tkdnd::drop_target register . DND_Text
bind . <<Drop>> {puts %D; list copy}

and this time no errors were raised, but the even handler was not called almost at all - I managed to get it colled once per 10-20 drops of text. Then after few more drops I closed "." window and I had to wait couple of seconds for application to exit - then it crashed with Segmentation Fault.

Can I help you somehow? Can I debug it somehow? I'm using ix86 binary from SF downloads.

Regards,
Pawel

George Petasis

unread,
Jul 12, 2012, 3:43:12 PM7/12/12
to
Does it help if you click on the Tk window after the drop?

To say the truth, I haven't yet checked why these events are missed, I
have been somewhat busy with apache rivet :-)

George

Googie

unread,
Jul 13, 2012, 12:44:16 PM7/13/12
to
> Does it help if you click on the Tk window after the drop?
>
Indeed it does! Works every time.

> To say the truth, I haven&#39;t yet checked why these events are missed, I
> have been somewhat busy with apache rivet :-)

I didn't know you're involved in that project. What ya cookin' there? ;) New features, or bug fixing?

Cheers,
Googie

Georgios Petasis

unread,
Jul 13, 2012, 1:51:44 PM7/13/12
to
Στις 13/7/2012 19:44, ο/η Googie έγραψε:
>> Does it help if you click on the Tk window after the drop?
>>
> Indeed it does! Works every time.

I know. It seems that Tk needs to be somehow "waken up" to process the
events. I haven't located why this is happening yet.

Have you also tested dragging from Tk to other GTK/Qt apps?

>
>> To say the truth, I haven&#39;t yet checked why these events are missed, I
>> have been somewhat busy with apache rivet :-)
>
> I didn't know you're involved in that project. What ya cookin' there? ;) New features, or bug fixing?

No, I am not involved in the project, I am trying to use it. And so far
I am impressed with it. I have written a small web service used by a
small web app, and the service is really fast.

George

Christian Gollwitzer

unread,
Jul 13, 2012, 2:52:29 PM7/13/12
to
Am 13.07.12 19:51, schrieb Georgios Petasis:
> Στις 13/7/2012 19:44, ο/η Googie έγραψε:
>>> Does it help if you click on the Tk window after the drop?
>>>
>> Indeed it does! Works every time.
>
> I know. It seems that Tk needs to be somehow "waken up" to process the
> events. I haven't located why this is happening yet.
>

Please excuse me that I've not looked into the sources by myself, but
might it be possible to use Tcl_ThreadAlert to wake up Tk's event
processing?

Christian


Georgios Petasis

unread,
Jul 13, 2012, 5:41:41 PM7/13/12
to
I have tried to add calls to Tcl_ThreadAlert(), but it didn't improve
things much. XFlush(display) seem to help more.

I have kept these calls to the sources though...

George

Googie

unread,
Jul 14, 2012, 1:48:05 AM7/14/12
to
> Have you also tested dragging from Tk to other GTK/Qt apps?

Just did so. It works like a charm with a DND_Text. I tried Qt, GTK and OpenOffice (not sure what toolkit it uses).

I'm not sure how am I suppose to do it with DND_File. It would be great to have it described in the manual as well (I refer to this one http://www.ellogon.org/petasis/tcltk-projects/tkdnd/tkdnd-man-page ).
I also miss description of what do "copy, move, link, ask, private and refuse_drop" mean. What happens if I provide "copy" and what if "private", etc.
Although I realize that writing docs isn't the most exciting thing to do.

Regards,
Pawel

Georgios Petasis

unread,
Jul 14, 2012, 9:21:28 AM7/14/12
to Googie
I have added a small tutorial:

http://wiki.tcl.tk/36708

If you have any questions, or you want anything to be further clarified,
you can ask it here, so as to update the tutorial.

George

Gerald W. Lester

unread,
Jul 14, 2012, 10:31:54 AM7/14/12
to
On 7/14/12 8:21 AM, Georgios Petasis wrote:
> Στις 14/7/2012 08:48, ο/η Googie έγραψε:
>...
>
> I have added a small tutorial:
>
> http://wiki.tcl.tk/36708
>
> If you have any questions, or you want anything to be further clarified, you
> can ask it here, so as to update the tutorial.

George,

You may want to consider moving to Fossil and hosting at core.tcl.tk (and
mirror at chiselapp.com) -- then you get a source control system, bug
tracking system and wiki all for the price of one.

Just a thought.

--
+------------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+------------------------------------------------------------------------+



quiet_lad

unread,
Jul 14, 2012, 3:48:16 PM7/14/12
to
On Tuesday, June 19, 2012 3:39:03 AM UTC-7, Georgios Petasis wrote:
> I am pleased to announce version 2.5 of the TkDND extension.
>
> What is new in TkDND 2.5?
> --------------------------------------------------
>
> 1) Improved support for accepting drops under Linux.
>
> 2) Added support for dragging under Linux.
>
> 3) Fixes for the CF_HDROP type under Windows.
>
> 4) A new cross-platform type (DND_Color) for transferring colors.
> Currently available only under UNIX (XDND protocol).
>
> This is the first TkDND 2.x release that has support for both dragging
> and dropping under all 3 major operating systems (Windows, OS X, Linux).
>
> A detailed change log can be found here:
>
> http://tkdnd.svn.sourceforge.net/viewvc/tkdnd/trunk/Changelog?revision=78
>
> What is TkDND?
> --------------------------------------------------
> TkDND is a binary extension for Tk, which adds native drag &amp; drop
> capabilities to the Tk toolkit. It can be used with any Tk version equal
> or greater to 8.3.3 and currently only the UNIX (X-Windows), Microsoft
> Windows (XP, Vista, 7) and OS X (Leopard) operating systems are
> supported (Tk 8.6 is required for OS X).
>
> The project home page, including documentation, examples and download
> links, can be found at:
>
> https://sourceforge.net/projects/tkdnd/
>
> http://www.ellogon.org/petasis/tcltk-projects/tkdnd
>
> How to get it?
> --------------------------------------------------
> TkDND can be downloaded from the following locations:
>
> Sources:
> http://sourceforge.net/projects/tkdnd/files/TkDND/TkDND%202.5/tkdnd2.5-src.tar.gz/download
>
> Windows 32bit Binaries:
> http://sourceforge.net/projects/tkdnd/files/Windows%20Binaries/TkDND%202.5/tkdnd2.5-win32-ix86.zip/download
>
> Windows 64bit Binaries: -
>
> Linux 32bit Binaries:
> http://sourceforge.net/projects/tkdnd/files/Linux%20Binaries/TkDND%202.5/tkdnd2.5-linux-glibc2.15-ix86.tar.gz/download
>
> Linux 64bit Binaries:
> http://sourceforge.net/projects/tkdnd/files/Linux%20Binaries/TkDND%202.5/tkdnd2.5-linux-glibc2.15-x86_64.tar.gz/download
>
> OS X 10.7.3 64bit Binaries: -
>
> All files: https://sourceforge.net/projects/tkdnd/files/
>
> George Petasis

Gosh I thought you hasd programmed advanced dungeons and dragons into tcl with atuomated character generators.
0 new messages