NSTextField's subclass...
NSTextField's subclass...
- Subject: NSTextField's subclass...
- From: Jean-Nicolas Jolivet <email@hidden>
- Date: Sat, 14 Feb 2009 14:02:47 -0500
Hi there!
I'm working on an NSTextField subclass (basically I need to change the
TextField's appearance so it fits with an HUD style window)
So far I've subclass it and overrode drawRect: so that I can draw my
custom background... it's working well, however my problem is that
when the text field is being edited, the editor (I'm guessing it's an
NSTextView or NSText ?) anyway, it's being drawn several pixels too
high... I took a quick screenshot that demonstrates the problem here:
http://screencast.com/t/E8ybu14j
When the textfield is not being edited (i.e. [self currentEditor] ==
nil) I'm drawing the string myself (using [[self stringValue]
drawAtPoint:]) so that way I can draw it at the correct height, but I
was wondering if it was possible to do something about the editor
being drawn a couple of pixels too high when the text field is edited?
I subclassed NSTextFieldCell and I'm trying to look at a method to
override that could help me (I would like to avoid having to draw the
whole cell manually when all I need is to offset the editor by a
couple of pixels)
Anyone has an idea?
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_______________________________________________
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