• 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: Subclassing NSTextFieldCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Subclassing NSTextFieldCell
      • From: "I. Savant" <email@hidden>
References: 
 >Subclassing NSTextFieldCell (From: "Michael Varlik" <email@hidden>)

  • Prev by Date: Re: Running process as root from Cocoa
  • Next by Date: Re: Subclassing NSTextFieldCell
  • Previous by thread: Subclassing NSTextFieldCell
  • Next by thread: Re: Subclassing NSTextFieldCell
  • Index(es):
    • Date
    • Thread