Mailing Lists: Apple Mailing Lists

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

Re: Interface Builder 3 and Custom Views



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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>)



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.