Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

where to put on-resize calculations in NSCell?



Hey--

I'm building an NSCell whose interior requires a fair amount of geometry calculation that depends on the geometry of the cell frame.  I need to know the geometry both for drawing the cell guts and for understanding user mouse input so I'd like to calculate the geometry only when the containing control size changes and store that information.  Problem is, it doesn't appear that any of the cell sizing functions really get called.

I've instrumented:
-(void)calcDrawInfo:(NSRect)aRect
-(NSSize)cellSize
-(NSSize)cellSizeForBounds:(NSRect)aRect
-(NSRect)drawingRectForBounds:(NSRect)theRect
-(NSRect)imageRectForBounds:(NSRect)theRect
-(NSRect)titleRectForBounds:(NSRect)theRect
-(NSControlSize)controlSize

and none of them get tripped at launch or on resize.

It's probably a safe bet that whatever the user is interacting with whatever was last drawn, so I could probably do all of this in the drawInteriorWithFrame:inView:, but that seems wrong to me.  How is this supposed to be done?  Are there any messages on resize other than draw?

Thanks--
 Greg

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.