How do you keep text from wrapping in an NSTableView using NSAttributedString
        Posted  
        
            by Justin
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Justin
        
        
        
        Published on 2010-05-24T22:28:28Z
        Indexed on 
            2010/05/25
            7:41 UTC
        
        
        Read the original article
        Hit count: 319
        
objective-c
|cocoa
I have an NSTableView that has 2 columns, one for an icon and the other for two lines of text. In the second column, the text column, I have some larger text that is for the name of an item. Then I have a new line and some smaller text that describes the state of the item.
When the name becomes so large that it doesn't fit on one line it wraps (or when you shrink the window down so small that it causes the names to not fit on a single line).
row1===============
| image |  some name   |
| image |   idle               |
row2================
| image |  some name really long name   | <- this gets wrapped pushing 'idle' out of the view
| image |   idle               |
===================
My question is, how could I keep the text from wrapping and just have the NSTableView display a horizontal scroll-bar once the name is too large to fit?
© Stack Overflow or respective owner