Re: [MACTCL] Cocoa vs. Tk
by Bill Northcott other posts by this author
Jul 10 2007 5:22PM messages near this date
Re: [MACTCL] Cocoa vs. Tk
|
Re: [MACTCL] Cocoa vs. Tk
On 11/07/2007, at 5:07 AM, Kevin Walzer wrote:
> I'm dabbling with learning Cocoa/Objective-C, to extend my knowledge
> beyond Tk and to expand my development options given the uncertainty
> over TK-Aqua's Carbon foundation, and I'm struggling with some
> cognitive
> dissonance. Please bear with me.
A few months back, I needed a slick GUI to manually enter data
extracted from watching videos. I had a go with TclTk but I was
getting nowhere. So I decided to bite the bullet and try to learn
Cocoa. I worked through Aaron Hillegass' excellent beginners book
and then started writing code.
Like you, I started by writing all sorts of stuff to manipulate the
GUI. However, over time, it dawned on me that my gui code was
actually unnecessary and I found myself progressively deleting it
all. Now when I look at the current versions of the app, all the GUI
code is in the nib constructed using the IB gui. My Objective-C code
only implements the model logic needed in response to user actions in
the GUI. In my case this mainly means enforcing data integrity on
whatever the user tries to enter. With the understanding I have now
gained, I could wrap a gui around some new model logic very quickly.
Yes, it was a big learning curve. Particularly the Bindings/KVC
stuff, but that is where the joy is because, once you have it sorted,
the need to write code goes away. The bonus is you can end up with
this lovely fluid and mode free GUI. I suspect your main difficulty
is that you are good at Tcl/Tk. So that you think of the GUI in Tcl/
Tk terms and then try to implement it in Cocoa, which of course
leaves you tied in knots. The code examples you give seem to me to
be typical of the unnecessary stuff which I wrote and later threw
away. It was not that one could write it very succinctly, as in Tcl/
Tk. It was that it did not need to be written at all.
I would recommend the journey, but I won't pretend it is easy.
Cheers
Bill Northcott
PS I not quite as old as one of the posters, but I was writing
Fortran code onto paper tape 40 years ago, when we thought 128K words
was a really huge amount of core store.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Tcl-mac mailing list
tcl-mac@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-mac
Thread:
Kevin Walzer
Jerry LeVan
Bill Northcott
Tim Jones
Kevin Walzer
Tim Jones
|