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

Similar Threads
thread Thread Starter Forum Replies Last Post
iPad: Where would an iPad fit in? stonyboys iPad 11 Nov 18, 2013 07:02 PM
Is Aperture a fit for me? twoehr Digital Photography 10 Oct 29, 2013 10:22 AM
Would a Powerbook G4 fit in this? SawyerTHEBEST PowerPC Macs 23 Feb 13, 2013 07:04 AM
Where does AE fit into my editing? matteusclement Digital Video 23 Jan 11, 2013 02:37 AM
Binding an NSNumber to an NSTableColumn BadWolf13 Mac Programming 4 Dec 30, 2012 03:49 AM

Forum Jump

All times are GMT -5. The time now is 06:50 PM.

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

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