• 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: NSTextFieldCell subclass - location of text displayed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextFieldCell subclass - location of text displayed


  • Subject: Re: NSTextFieldCell subclass - location of text displayed
  • From: j o a r <email@hidden>
  • Date: Mon, 30 May 2005 22:41:59 +0200


On 30 maj 2005, at 22.10, Hannes Friederich wrote:

I'm trying to implement a subclass of NSTextFieldCell which draws its text at a different location. I actually want to add some image WITHIN the cells borders, similar to the address field of Safari.
Hovewer, I cannot find any method to tell the NSText subsystem (which does the actual drawing), to draw the text at a different place than the default one.

You can subclass a cell and call super with a modified frame in the drawing method "drawInteriorWithFrame:inView:", that should allow you to offset the drawing of the text. In that same method you can also draw your image. There are probably other methods that you need to override to make the implementation work like in Safari, but that should at least be able to get you started. I'm also sure that if you look around, in the list archives or on the web, you'll find more concrete examples of how to implement custom drawing in a NSCell subclass.


j o a r



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTextFieldCell subclass - location of text displayed
      • From: Hannes Friederich <email@hidden>
References: 
 >NSTextFieldCell subclass - location of text displayed (From: Hannes Friederich <email@hidden>)

  • Prev by Date: Re: Guidance
  • Next by Date: NSComboBoxCell example
  • Previous by thread: NSTextFieldCell subclass - location of text displayed
  • Next by thread: Re: NSTextFieldCell subclass - location of text displayed
  • Index(es):
    • Date
    • Thread