Path: utzoo!attcan!uunet!comp.vuw.ac.nz!actrix!Bruce.Hoult From: Bruce.Hoult@bbs.actrix.gen.nz Newsgroups: comp.sys.mac.programmer Subject: Re: C++ programming under MPW - advice sought Message-ID: <1990Dec12.070637.4395@actrix.gen.nz> Date: 12 Dec 90 07:06:37 GMT References: <1082@exua.exeter.ac.uk> Sender: Bruce.Hoult@actrix.gen.nz (Bruce Hoult) Organization: Actrix Information Exchange, Wellington, New Zealand Lines: 60 Comment-To: kt@msor.msor Keith Tizzard writes: >I am trying to use C++ under MPW and would welcome some advice and help. >The C++ language creates no problem since I have used it in other environments. >The problem comes when I try to find out about the MacApp classes and their >methods. > >Where do I look for a clear description? >Do I need to acquire and read all the volumes of Inside Macintosh? >Is there a class browser to enable me to find out, quickly and easily >what classes are available to inherit and what member functions they contain? I you have a version of MacApp that works with C++ then you also have the MacApp documentation and the program "Mouser" -- a browser that works with both C++ and Object Pascal code. You should also get Inside Mac available for reference. >The following code is taken from ShapesApp.cp, one of the files in the >distributed C++ examples which come with MPW. Reading the code is difficult >and the thought of creating new code is awe inspiring. Within the class >constructors and member functions very little appears to be object orientated. ShapesApp doesn't use MacApp. It is directly using the facilities in the Mac ROMs and O/S. These facilities aren't object oriented. >In the constructor TShapesApp, shown below, are SetMenuBar(), DisposHandle(), >DrawMenuBar() ... external functions (i.e. C) or are they inherited member >functions? Why does it not say: They are all functions built into the ROMs of every Mac since the 128K machine in 1984. You'll find that they are implemented as inline code that compiles to 68000 "TRAP" instructions. >In the following member function why do we have: ? > >EnableItem(menu, iNew); instead of menu->EnableItem(iNew) >DisableItem(menu, iClose); instead of menu->DisableItem(iClose); Once again, these are calls to non-object oriented stuff in the Mac ROMs. >When using a set of existing classes, easily accessible documentation is >needed. By that I mean, a list of all the classes together with their >member functions plus a clear description of what each one does. The ShapesApp example doesn't use MacApp. It doesn't use a set of existing classes. Perhaps you should look at the C++ MacApp examples (Nothing, DemoText and DemoDialogs) in the :MPW:MacApp:Examples:CPlusExamples: folder... -- Bruce -- Bruce.Hoult@bbs.actrix.gen.nz Twisted pair: +64 4 772 116 BIX: brucehoult Last Resort: PO Box 4145 Wellington, NZ