• 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
Re: Why isn't sizeToFit being called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why isn't sizeToFit being called?


  • Subject: Re: Why isn't sizeToFit being called?
  • From: Ricky Sharp <email@hidden>
  • Date: Tue, 7 Dec 2004 19:39:42 -0600


On Dec 7, 2004, at 5:29 PM, Ricky Sharp wrote:

Some of my custom widgets derive from NSControl and so I provided an implementation of sizeToFit that will do the right thing. This works out well.

The remainder of my widgets derive from NSView. But when I implement sizeToFit, it's never called from within IB.

I know that other NSView derivatives implement sizeToFit and they work a-ok in IB (e.g. NSBox).

AFAIK, there's no special protocol to implement.

OK, things get even crazier. I just created a new IBPalette and whipped up an extremely simple object derived from NSBox. By simple, I mean that I overrode nothing except for sizeToFit.


But my sizeToFit isn't being called. What makes matters worse is that the base classes's sizeToFit is being called instead. I know this because the view resizes as if it were a standard NSBox.

Furthermore, I noticed several other wacky things with this simple NSBox derivative.

I swear that deriving from Apple's widgets is evil :P

I think I may have to e-mail DTS on this one as only an IB engineer would know what's really going on. My guess is that there's code in there that is hard-wired to work with only specific classes.

I would have assumed that IB would have queried if a particular object responded to sizeToFit and call that object's implementation if it existed. But this doesn't seem to be the case.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
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


References: 
 >Why isn't sizeToFit being called? (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: delay function
  • Next by Date: Re: delay function
  • Previous by thread: Why isn't sizeToFit being called?
  • Next by thread: sorting on floats
  • Index(es):
    • Date
    • Thread