• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
where to put on-resize calculations in NSCell?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: controls in menu
  • Next by Date: Re: NSCalendar bug with adding to pre-1919 dates?
  • Previous by thread: Re: controls in menu
  • Next by thread: How to cleanup visual feedback from setDropRow
  • Index(es):
    • Date
    • Thread