• 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: Superimpose a NSTextField over NSImageView? [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Superimpose a NSTextField over NSImageView? [SOLVED]
      • From: Ryan Britton <email@hidden>
References: 
 >Re: Superimpose a NSTextField over NSImageView? (From: Erik Buck <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? [SOLVED] (From: desktoast music productions <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? [SOLVED] (From: "M. Uli Kusterer" <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? [SOLVED] (From: Henry McGilton <email@hidden>)

  • Prev by Date: Re: Getting a table to resize columns. I'm doing everything right but it's not working?
  • Next by Date: Custom view - newbie stumped
  • Previous by thread: Re: Superimpose a NSTextField over NSImageView? [SOLVED]
  • Next by thread: Re: Superimpose a NSTextField over NSImageView? [SOLVED]
  • Index(es):
    • Date
    • Thread