Re: Interface Builder 3 and Custom Views
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