[comp.sys.mac.programmer] 2 MacApp questions

charles@tasis.utas.oz (Charles Lakos) (02/02/89)

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?


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)?


Charles Lakos.

ACSnet: charles@tasis.utas.oz
ARPA:   charles%tasis.utas.oz@uunet.uu.net
UUCP:   {enea,hplabs,mcvax,uunet,ukc}!munnari!tasis.utas.oz!charles
Snail:  Computer Science Dept., University of Tasmania,
	GPO Box 252C, Hobart, TAS, 7001, Australia.

keith@Apple.COM (Keith Rollin) (02/05/89)

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

charles@tasis.utas.oz (Charles Lakos) (02/15/89)

In article <25319@apple.Apple.COM>, keith@Apple.COM (Keith Rollin) writes:
>       [stuff deleted]
> >
> >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.
> 

Firstly, thank-you for your response - I am responding by news because I
couldn't get through with mail.  Secondly, I am not aware of putting
any of my methods into MARes or MAScroll.  In fact, I just did a test - I
took the DrawShapes sample program, requested the inclusion of UTEView and
UDialog, added a couple of statements to reference methods in these units,
and attempted to build it with 'debug' set.  The segment GRes was too large.

I can only conclude from this simple test that my original assumption
was correct, namely that the supplied units were not properly segmented 
and that there is little I can do about it.

Charles Lakos.

ACSnet: charles@tasis.utas.oz
ARPA:   charles%tasis.utas.oz@uunet.uu.net
UUCP:   {enea,hplabs,mcvax,uunet,ukc}!munnari!tasis.utas.oz!charles
Snail:  Computer Science Dept., University of Tasmania,
	GPO Box 252C, Hobart, TAS, 7001, Australia.