• 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: Interface Builder 3 and Custom Views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interface Builder 3 and Custom Views


  • Subject: Re: Interface Builder 3 and Custom Views
  • From: Nick Toumpelis <email@hidden>
  • Date: Sun, 20 Jan 2008 12:43:41 +0200

According to the docs*, the underlying NSCell handles the actual drawing of the control. When controls want to draw themselves, they send a drawWithFrame:inView: message to their cell.

Try moving your drawing code to a subclass of NSButtonCell** and replace NSButton and NSButtonCell with your custom subclasses***. That should work.

Hope this helps,

Nick



* http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/Concepts/ControlsAndCells.html
** http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/Tasks/SubclassingNSCell.html
*** http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/Tasks/SubclassingNSControl.html

On 20 Ιαν 2008, at 12:07 ΜΜ, [nexUmoja] Fabian Jäger wrote:

With Interface Builder 2 it worked without any problems to use a Custom View and change its class to my NSButton subclass...
I already tried to change the class of an NSButton in Interface Builder 3 to my subclass, but unfortunately it does not change its appearance accordingly. It seems not to change the class of the button :-(


Fabian

Am 20.01.2008 um 10:49 schrieb Nick Toumpelis:

As far as I can tell, CustomView is only suitable for subclasses of NSView. NSButton is further down the line of inheritance and IB doesn't work with it like it does normally ...

What about, starting with NSButton and specifying the Class value as your own subclass?

Nick

____________________________________________________________ Nick Toumpelis email: email@hidden BEng (Wales), MSc (Manchester) Software Developer Thessaloniki, Greece






_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Interface Builder 3 and Custom Views (From: " [nexUmoja] Fabian Jäger" <email@hidden>)
 >Re: Interface Builder 3 and Custom Views (From: Nick Toumpelis <email@hidden>)
 >Re: Interface Builder 3 and Custom Views (From: " [nexUmoja] Fabian Jäger" <email@hidden>)

  • Prev by Date: Re: why are there zero examples in the cocoa docs?!
  • Next by Date: Re: beyond MV and (one) C
  • Previous by thread: Re: Interface Builder 3 and Custom Views
  • Next by thread: Re: Interface Builder 3 and Custom Views
  • Index(es):
    • Date
    • Thread