Custom drawing in an NSTextField
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.