Re: NSTextField Image
Re: NSTextField Image
- Subject: Re: NSTextField Image
- From: "I. Savant" <email@hidden>
- Date: Thu, 12 Apr 2007 11:40:15 -0400
If the graphic is to be uneditable (such as the caps-lock indicator
in the password field), then simply subclass NSTextFieldCell and
override the appropriate drawing method(s) (such as
-drawInteriorWithFrame:inView:).
Divide up whatever frame you're passed into text and graphic areas.
Draw your graphic in the appropriate area, then call super's
implementation, passing the smaller frame where the text should
appear.
As for editing, take the same approach as above with the
-editWithFrame:inView:editor:delegate:event: method, passing the
adjusted frame (your text area) to super along with all the other
arguments.
This is covered in the documentation:
http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/index.html
Hope this helps. If I've missed anything, list, feel free to add / correct.
--
I.S.
On 4/12/07, Michael Novak <email@hidden> wrote:
Hello All,
I am interesting in have a small graphic displayed in a NSTextField.
Can anybody point me in a direction or maybe where I can find info in the
docs? I went looking around but nothing I saw seemed to be appropriate for
what I am after. Thanks!
Cheers,
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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