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

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


References: 
 >NSTextField Image (From: "Michael Novak" <email@hidden>)

  • Prev by Date: Re: Problem with AESend() - Update
  • Next by Date: Re: WM_KEYDOWN
  • Previous by thread: NSTextField Image
  • Next by thread: RE: NSTextField Image
  • Index(es):
    • Date
    • Thread