• 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
Custom drawing in an NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom drawing in an NSTextField


  • Subject: Custom drawing in an NSTextField
  • From: Andy <email@hidden>
  • Date: Sat, 20 Jul 2002 17:10:43 -0400

I'd like to draw some lines around the text in an NSTextField.

So I'm currently thinking of

(i) subclass NSTextField to set its cell to a custom cell class
(ii) create a custom cell class for use with (i). Do the drawing ontop
of the text.

If I need data from the NSTextField subclass while in the
NSTextFieldCell subclass, I can use NSCell's controlView method to get
hold of my text field - unfortunately I'll have to cast it to my
NSTextField subclass.

2 questions:

Do I need 2 custom subclasses to do this, or is there some clever
interface builder trick to set a custom cell class for a particular
NSTextField? ie, can I avoid subclasses NSTextField?

Am I completely mad? Would I be better off implementing an NSView
subclass and just handling drawing the text, the lines and handling the
mouse (drag and drop) for myself?

--
AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside

I think we finally found the killer app for Flash: animated stick men
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Setting the receiving textfield in code
  • Next by Date: Before applicationDidFinishLaunching, before everything :]
  • Previous by thread: RE: Setting the receiving textfield in code
  • Next by thread: Before applicationDidFinishLaunching, before everything :]
  • Index(es):
    • Date
    • Thread