Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!rutgers!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: 2 MacApp questions Keywords: icon labels, segment sizes Message-ID: <25319@apple.Apple.COM> Date: 5 Feb 89 00:53:24 GMT References: <816@tasis.utas.oz> Organization: Apple Computer Inc, Cupertino, CA Lines: 40 In article <816@tasis.utas.oz> charles@tasis.utas.oz (Charles Lakos) writes: >1. Labels for icon-like objects? > >I am writing a program which will draw icon-like objects with labels >in a window, something like the icons in the Mac desktop. Is there any >ready-made object definition(s) in MacApp to handle the labels, or do I >have to code it all myself? or use a dialog? > You will have to handle this yourself. However, it is no big hassle. All you have to do is sub-class TIcon, add an instance variable to hold the name, and override TYourIcon.Draw to draw the name. You may also have to override ControlArea to allow for a little space under the icon for your title; normally, ControlArea returns the entire bounding rectangle of the control, with space adjusted for any adornment you may have. TIcon.Draw takes this rectangle and scales the icon to it. > >2. Supplied units not properly segmented? > >In testing a small application (somewhat akin to the MacApp DrawShapes >sample program), the code segment 'GRes' is too large if I compile in >debug mode. The supplied units I include are UObject, UList, UMacApp, >UPrinting, UTEView and UDialog. Has anyone come across this problem? >Any solution (apart from the obvious one of compiling in nodebug mode)? > Are you putting any of your routines/methods into either the MARes or MAScroll segments? It is these segments that are put into GRes during final linking. Looking at the Nothing sample, I see that it is fairly substantial already, weighing in at over 29K. The solution to this would be to put your routines into another segment, possibly one of your own. If you would like to make this segment resident (as GRes is), then call SetResidentSegment on it, or include it in your 'res!' resource. ----------- Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your limitations, and sure enough...they're yours" -Bach, Illusions