Re: Porting Tk applications to Cocoa
Re: Porting Tk applications to Cocoa
- Subject: Re: Porting Tk applications to Cocoa
- From: Kaelin Colclasure <email@hidden>
- Date: Sun, 8 Jul 2007 13:23:04 -0700
On Jul 8, 2007, at 12:10 PM, Kevin Walzer wrote:
I'm looking for suggestions on the best strategies for porting
applications written in scripting languages and using a Tk GUI to
Cocoa.
I currently have several shareware applications, using Tk for the
GUI and Python and Tcl for the back-end languages. Tk is a
powerful, flexible GUI toolkit, but it has some limitations on
Aqua--it doesn't wrap some of the widgets and, in general, simply
can't keep up with UI trends on OS X. Even with a lot of recent
development in the Tk core that support theming, my applications
look a bit out of place And because Tk builds on Carbon, the recent
announcements by Apple about 64-bit Carbon (or lack thereof) have
made me nervous about Tk's future on OS X.
I've picked up the standard Cocoa textbooks (Hillegass, Kochan) and
I'm trying to learn the basics of Cocoa and Objective-C. This,
however, doesn't give me much guidance on how to proceed porting my
stuff over. I see several options:
1. Do a complete rewrite of my applications in Objective-C.
2. Do a complete rewrite of my applications in a scripting language
supported by Cocoa, such as Python or AppleScript.
3. Rewrite the GUI components only in Objective-C and leave the
business logic as is (in Tcl or Python), with some refactoring.
4. Rewrite the GUI components only in one of the Cocoa scripting
languages, and refactor the business logic.
Given the circumstances you describe, I would suggest pursuing option
4 or possibly option 3. The primary reason is that the refactoring
route will tend to focus you on how best to interface your code with
Cocoa. Since you are just learning Cocoa at this point, this is not
the ideal time to be re-designing your applications for a Cocoa-based
rewrite.
Completing the project as a refactoring exercise will hopefully
hilight for you where your customary design practices fit naturally
with Cocoa and where there is an impedance mismatch. Along the way,
you may find that Cocoa suggests alternative ways to organize your UI
both functionally and visually. At some point you may decide that the
whole code base would benefit from more extensive rewriting, but at
that time hopefully you will be comfortable with "The Cocoa Way" and
flush with ideas of how to improve the program during the process. :-)
HTH,
-- Kaelin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden