The Mac Interface

The Mac interface has been very influential in the development of GUIs. It is however important to note that like much of the modern computing environment (PC's, ethernet, GUIs) it was pioneered at Xerox parc.

When Apple first came out with the Mac (and indeed ever since) they maintained tight control over the style of the interface. Developers were required to conform to the Mac style, this had the effect that the learning curve for new Mac applications was generally shorter than for other applications. (One of the complaints about Word for the MAC is that if the user had wanted a windows GUI they would have bought an IBM compatible.)

Hypercard is one example of an innovative Mac program. It is one of the first commercial "visual programming" environments. It allows non programmers to create useable systems based on the metaphor of a pile of index cards, with links between cards. This gives it a hypertext flavour. In addition it is possible to place buttons on a card and have the buttons invoke programs.

As in Microsoft C++ a Mac windows program is started by the constructor for TAppApp. Here is an example constructor. (Taken from Portable GUI development with C++ by Mark Watson).



       SysEnvRec   envRec;

      // Initialize Mac Toolbox components

     InitGraf((Ptr) &qd.thePort);





     InitDialogs((ResumeProcPtr) nil);


     (void) SysEnvirons(curSysEvVers, &envRec);

     if (envRec.machine.Type  <  0) {

	        Warning("This machine does not have 128K ROMs !");



   MaxApplZone();    // create more zone space

   fHaveWaitNextEvent = trapAvailable(_WaitNextEvent, TooTrap);

   fWindow = nil;

   fWhichWindow = nil;

   fDone = false;

   fMouseRgn = nil;

   fInBackground = false;

   Handle menuBar;

   menuBar = GetNewMenuBar(rMenuBar);



   AddResMenu(GetMHandle(mApple), 'DRVR');


   fMouseRgn = NewRgn();

   // Make a single document window for this application:

   TAppWindow* tAppDoc;

    tAppDoc = new TAppWindow(rDocWindow);


The program is actually driven by the member EventLoop() of the TAppApp instance. At this level of detail the programmer has to forward the event to the appropriate class for handling.

Return to GUI home page

Last Changed: 10 May 1995