• 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
NSTextField width detection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextField width detection


  • Subject: NSTextField width detection
  • From: Jeremy Jurksztowicz <email@hidden>
  • Date: Sun, 6 Oct 2002 14:14:53 -0400

Hello,

After searching the archives and the internet I am still having trouble with this.
I would like to know how to find out how much of a string an NSTextField of
fixed size can hold. In particular I have a field which holds a file path, and I want
to trim large paths to fit in my field. For Example:

Actual Path: "/Users/MyUserName/Documents/SomeFile.extension"

Sized To Fit: "../Documents/SomeFile.extension"

I have found no way of finding out how much an NSTextFeild can hold.
I have thought of just using a fixed width font and counting the number of
characters that can fit in IB, but that would look ugly.

Any Help or pointers to code would be much appreciated. Thank You.

Jeremy J.
_______________________________________________
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: Add rtf line to RTF file
  • Next by Date: [Q] Using fonts in NSTextView
  • Previous by thread: Re: Add rtf line to RTF file
  • Next by thread: Re: NSTextField width detection
  • Index(es):
    • Date
    • Thread