where to put on-resize calculations in NSCell?
where to put on-resize calculations in NSCell?
- Subject: where to put on-resize calculations in NSCell?
- From: Gregory Best <email@hidden>
- Date: Tue, 28 Feb 2006 19:06:15 -0800
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:
This email sent to email@hidden