| Code by Kevin | |||||
|
Subscribe to RSS Feed 2010 2009 2008 2007 2006 Categories Business Software General |
home
Thu, 26 Nov 2009
More progress on adding features to Tk-Cocoa
First, the good news... Drag-and-drop. I'm making some good progress on my project to port TkDND to OS X: I've successfully gotten Tk widgets to recognize files and strings of text that are dragged to it. I still have to do some work on integrating my code with TkDND itself, which will take some time--but the hardest part is over. I won't be implementing drags from Tk windows to other Mac windows or the Finder/desktop, because that's considerably more complicated. Even with this limitation, being able to drag files and text directly to Tk windows will be a big improvement in usability and Mac-native integration. Custom sheets. Tk has long supported "sheets"--dialogs that slide down from the window--with standard system dialogs, file choosers, and so on. It hasn't supported custom dialogs that a programmer may choose to implement, such as a password dialog. With just a couple of days of work, I've got a decent implementation put together. The slide-down of custom dialogs isn't as smooth as system dialogs (because of some differences in how Tk draws windows and how Cocoa manages the "sheet" effect), but it's good enough for my requirements--and again, a nice improvement in usability and integration. I've gotten the Cocoa-level code working fine; I have to add some additional script-level code (based on the prototype code I've been hacking on) to make the package complete. Next, the bad news... Native Cocoa printing/dialogs. I've decided not to attempt to develop a Tk extension that provides system-native (Cocoa-based) printing. The command-line tools to support printing on OS X are superb, as I've discussed before, and native printing dialogs simply won't offer a huge improvement over what I am already doing. My one serious motivation for exploring native printing was the inability of the command-line tools to print HTML well. I've been using an open-source tool called HTMLDoc to generate a PDF file from HTML, which I can then print via the command-line. HTMLDoc does a good job, but it is a large program, and because it is licensed under the GPL, I have to include the source code for the program with my applications; the combination of these two things greatly increases the size of my applications. However, more recently I've run across a command-line tool called wkpdf--a Cocoa-native WebKit (HTML)-to-PDF tool that uses the Cocoa frameworks for the conversion. It's much smaller than HTMLDoc and works a bit better, to boot, so this solves my HTML-printing problem. As a result, I have no real need for a Cocoa-native printing solution, and won't be pursuing this. Finally, on the to-do list... Dock icons and native Mac icons. I've developed several packages in the past year to integrate native Mac icons in my applications, to modify the Dock icon of my programs, and to add a badge to the Dock icon. Some of these I've released as open-source, and some I haven't. I plan to do a bit more work on expanding and polishing the capabilities of these extensions; then I will do a big release of them. It's my hope that others will find my work on these projects beneficial, but I'm doing them first and foremost to improve the capabilities of my commercial applications: that's why I have to pick and choose among the many possibilities for (unpaid) open-source work that I run across. I've been working on these projects for several weeks now, and eventually I need to get back to working on applications that users pay for. After this round of projects is done, my applications will have several new capabilities, which will make them more pleasant to use. |
||||