[comp.sys.mac.programmer] TransSkell

chuq@plaid.Sun.COM (Chuq Von Rospach) (02/29/88)

>First, Transkel sounds very useful. Could someone describe it a bit
>and let me know where it can be found?

Since I've been a big pusher of TranSkel on various fronts, I'll take a stab
at it. Stay tuned for a special announcement at the end of this, too.

TransSkell is an application skeleton. Unlike traditional skeletons (the
famous 'skel' program or the generic applications in the various Mac
progrmaming books) this takes a library format. You don't go hacking the
generic skeleton to customize it, you write an applicaiton that calls
routines that implement the skeleton.

This is really nice. It's not quite an object oriented system, but it's
close. It hides all the grotty code from you, and lets you worry more about
the application (rather than trying to hack the applicaiton into the
skeleton without breaking things). It protects you from the Mac's
programming interface.

Here's a sample program. This is basically a mini-Skel, written in
TransSkel:

#include <MenuMgr.h>
#define nil 0L

main()
{
	MenuHandle m;
	int DoFileMenu();

	SkelInit();
	SkelApple(nil,nil);
	m = NewMenu(2,"\pFile");
	AppendMenu(m,"\pQuit");
	SkelMenu(m,DoFileMenu,nil);
	SkelMain()
	SkelClobber();
}

DoFileMenu(item)
int item;
{
	SkelWhoa();
}

That's it. SkelInit() initializes the system. SkelApple turns on desk
accessories withouth an "about" box. NewMenu/AppendMenu/SkelMenu create a
"File" menu, which, when chosen, quits the applicaiton. SkelMain() does all
the work. This handles a full Mac application with no windows, but with DA's
and the File menu. In 15 lines of code of so.

There are two companion libraries: TransEdit and TransDisplay. TransDisplay
is a window support module, TransEdit handles windows where the user is
going to be editing text in it. 

It makes Mac programming almost plug and play. This stuff is written for
LightSpeed C. It's been ported to a number of different compilers, though.

Neat Stuff.

And now for the special annoucement. These packages are all available on
sumex in the info-mac archive. For those folks who don't have access to
ARPA, though, I've brought them over and installed them into my
archive-server. If you want to take a look at them, send the following mail
to the archive server:

% mail archive-server@plaid.sun.com
Subject: index mac

hi.
^d
%

for folks who want to know how the archive server works, replace 'index mac'
with (surprise) 'help'. For an index of everything in the archive server,
simply send it an 'index' command.

Please! do NOT send the archive-server requests to me. I"m not an archive
server, I'm a real person. I'll just laugh at you (and if this sounds silly,
history has shown that on average three people ignore the instructions every
time I announce something like this and simply do a reply. Functional
Illiteracy rules!)

Have ffun!!!





Chuq Von Rospach			chuq@sun.COM		Delphi: CHUQ

     There is no reason for any individual to have a computer in their home.
                               Ken Olson, President, Digital Equipment, 1977

dtw@F.GP.CS.CMU.EDU (Duane Williams) (02/29/88)

In message <43449@sun.uucp>, Chuq Von Rospach says the following about
Paul DuBois' TransSkel package:
| This is really nice. It's not quite an object oriented system, but it's
| close. It hides all the grotty code from you, and lets you worry more about
| the application (rather than trying to hack the applicaiton into the
| skeleton without breaking things). It protects you from the Mac's
| programming interface.

Now I am a big fan of TransSkel, but the above description is a gross
exaggeration.  TransSkel automatically handles only the most basic aspects
of the standard Mac event loop, the easiest part of a Mac program to figure
out.  It does DAs automatically, but that's almost as trivial to do as
Chuq's trivial example program.  As soon as you try doing something non-
trivial, you can't avoid learning about the Mac's programming interface.
TransSkel is useful, but it's no panacea.  It is also NOT close to being
object oriented.  (And you're living in an Other World if you seriously
think you can avoid dealing with the TransSkel source.)

One could easily write a cover package for TransSkel, that would be larger
as TransSkel itself, to implement features of the standard Mac interface
that TransSkel doesn't handle.

Duane Williams
dtw@cs.cmu.edu