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

Re: Metrics for a NSTextField


  • Subject: Re: Metrics for a NSTextField
  • From: Martin Wierschin <email@hidden>
  • Date: Thu, 26 Feb 2009 13:27:48 -0800

Hi Eric,

Sizing the editor may not be the window's responsibility- it may expect
the control to do so. What happens if you resize the NSTextView and/or
NSTextContainer yourself as needed?

This is possible, but the documentation does not say anything about this being necessary.


In fact, you might have to call additional methods before it is properly
usable, eg: "setUpFieldEditorAttributes:"

Well, the documentation for setUpFieldEditorAttributes: says:

Sets up the field editor. You never invoke this method directly; by
overriding it, however, you can customize the field editor.


I have no need to customize it...the default one it provides is just fine.

It may say that, but you're completely bypassing the normal way the field editor works. I think the documentation is written with the expectation that the editor will be configured by the control.


What isn't clear how I can get a NSLayoutManager that will layout the text in the same way as a NSTextField, but perhaps this isn't possible because NSTextField does custom layout apart from a NSLayoutManager.

I think you've hit upon the general problem. NSTextField wasn't designed for what you wish it to be. I'd either upgrade to a full NSTextView, which always has a dedicated NSLayoutManager attached, or roll your own control whose drawing method is controlled by you.


~Martin

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: 
 >Metrics for a NSTextField (From: Eric Gorr <email@hidden>)
 >Re: Metrics for a NSTextField (From: Eric Gorr <email@hidden>)
 >Re: Metrics for a NSTextField (From: Eric Gorr <email@hidden>)
 >Re: Metrics for a NSTextField (From: Eric Gorr <email@hidden>)

  • Prev by Date: custom control's value change isn't being noticed by controller
  • Next by Date: Custom Hit Testing with thousands of NSTextView's & cursorUpdate:
  • Previous by thread: Re: Metrics for a NSTextField
  • Next by thread: [ANN] BWToolkit 1.1 IB Plugin: Codeless Split Views
  • Index(es):
    • Date
    • Thread