Re: Superimpose a NSTextField over NSImageView? [SOLVED]
Re: Superimpose a NSTextField over NSImageView? [SOLVED]
- Subject: Re: Superimpose a NSTextField over NSImageView? [SOLVED]
- From: "M. Uli Kusterer" <email@hidden>
- Date: Mon, 24 Apr 2006 17:41:10 +0200
On 24/04/06, Henry McGilton <email@hidden> wrote:
>
> I must be missing something critical here. What is wrong
> with just having the image view and using the NSString
> drawing additions to superimpose the text ?
For one thing, performance. NSStringDrawing creates and tears down several
text system objects to draw a string. It also doesn't necessarily wrap text.
An NSTextView carries arround its text system objects and reuses them.
Also, you can use bindings with an NSTextField or NSTextView while you'd
have to write a bunch of code to use them with a subclassed NSImageView.
And did I mentioned you can just reuse an NSImageView and NSTextView instead
of having to subclass the former?
Mind you, I'd personally use IB for this, but the OP insisted on having to
do this programmatically, so I suggested use of addSubview. IMHO using IB is
the better choice. If you need custom border drawing, you can create a
reusable NSWindow subclass once and use it in other apps easily just by
dragging it into IB. I'm doing that with UKBorderlessWindow all the time.
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden