Long filename, short NSTextField...

  • Hello,

    this is probably a newbie question but I can't find any info on how to
    truncate and append "..." to a filename which does not fit in an
    NSTextField. Also, how would I go about doing the same with a full path,
    i.e. truncating at the beginning (the directories) and prepending "..."?
    Should I code it all by hand?

    Thanks in advance!

    Jurgen
  • On Feb 3, 2008, at 7:42 AM, Jurgen Vermeiren wrote:
    > this is probably a newbie question but I can't find any info on how to
    > truncate and append "..." to a filename which does not fit in an
    > NSTextField. Also, how would I go about doing the same with a full
    > path,
    > i.e. truncating at the beginning (the directories) and prepending
    > "..."?
    > Should I code it all by hand?

    In IB, bring up the inspector for your various NSTextField objects and
    set the "line breaks" to any of the "truncate" options that you need.

    ___________________________________________________________
    Ricky A. Sharp        mailto:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
  • On 2/3/08 2:42 PM, Jurgen Vermeiren said:

    > this is probably a newbie question but I can't find any info on how to
    > truncate and append "..." to a filename which does not fit in an
    > NSTextField. Also, how would I go about doing the same with a full path,
    > i.e. truncating at the beginning (the directories) and prepending "..."?
    > Should I code it all by hand?

    I encourage you not to use NSTextField to show a path.  Instead, use
    NSPathControl.

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
previous month february 2008 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29    
Go to today
MindNode
MindNode offered a free license !