Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 3, 2009, 11:15 PM   #1
McBgnr
macrumors regular
 
Join Date: Apr 2009
NSTableColumn autosizing to fit

Hello,

I have a NSTableView which has 2 columns. First columns contains strings. Some of these strings are long and are not visible completely in the column. I have also added HorizontalScroll bar to the TableView but no use. It scrolls the contents of the TableView but not of the column.

How can I request TableColumn to resize so that the longest string is the column is completely visible. The min and max width parameters of the TableColumn are set correctly. I have also tried using the Col. Sizing style but it did not help either. Any suggestions?
McBgnr is offline   0 Reply With Quote
Old Jun 4, 2009, 12:33 AM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
I don't think there's a built-in way to do this, if I'm understanding it correctly. You could just use NSAttributedString to get the width of the string at the font (via the tablecolumn's datacell) and then set the column's width to that (plus a bit more probably for spacing).
kainjow is offline   0 Reply With Quote
Old Jun 4, 2009, 05:03 AM   #3
McBgnr
Thread Starter
macrumors regular
 
Join Date: Apr 2009
I was wondering that there might be some built in way for this :-(. I will give a try to the other method using the attributed string.
McBgnr is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Is it really so hard to market a screen protector pre-cut to fit cases? Vesian iPhone Accessories 6 Sep 12, 2010 03:20 PM
Possible to resize all Finder windows to fit screen? ss957916 OS X 3 Oct 1, 2009 08:34 AM
Library to big to fit on Ipod GrayFoxSS iPod 3 Apr 11, 2009 09:08 AM
How to use an exponential curve to fit the data under Excel 2008 for Mac? hajime Mac Applications and Mac App Store 0 Nov 13, 2008 06:57 AM
how to resize pictures to fit ipod touch shadowmanifest iPod touch 6 May 7, 2008 12:23 PM


All times are GMT -5. The time now is 02:53 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC