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:
>> 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
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.
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:
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.
> 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:
> 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
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 :-)
>> 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'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.
> 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
I have tried to add calls to Tcl_ThreadAlert(), but it didn't improve things much. XFlush(display) seem to help more.
> 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.
>> 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.
> 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.
> 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: