Re: Subclassing NSTextFieldCell
Re: Subclassing NSTextFieldCell
- Subject: Re: Subclassing NSTextFieldCell
- From: Dave Batton <email@hidden>
- Date: Mon, 28 Jan 2008 14:50:20 -0700
Michael
I played a bit with NSTextFieldCell and found out that I have to
implement the "-(void)drawWithFrame:(NSRect)cellFrame inView:(NSView
*)controlView" method to change the
content of it's controlView. The question I have is how can I change
the content of this view?
OK, I'm not a Cocoa expert yet, but I'll take a shot at this.
First, subclass NSTextFieldCell and override the -stringValue method
(see NSCell) to return @"*****" if the user has selected this
preference.
Then in interface builder, select the text cell in the table that will
be displaying this field, and set the class to your new
NSTextFieldCell subclass.
That's about it.
--
Dave Batton
Mere Mortal Software
http://www.Mere-Mortal-Software.com/blog/
_______________________________________________
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