Re: NSTextFieldCell subclass - location of text displayed
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