• 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
Re: auto-sizing NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto-sizing NSTableView


  • Subject: Re: auto-sizing NSTableView
  • From: Austin Sarner <email@hidden>
  • Date: Sat, 22 Jan 2005 23:53:46 -0500

You can get the width out of the frame.

NSRect myRect;
myRect = [mainWindow frame]; // insert the frame of the longest cell here
NSLog(@"%d",myRect.size.width);


Hope this helps

On Jan 22, 2005, at 11:26 PM, chris struhar wrote:

How can I make an NSTableView resize so that the whole view is the size of the widest row? I have 2 columns in the NSTableView, the first is small and fixed width, the second is variable width, and the NSWindow is a transparent window. I would like to resize the NSTableView and NSWindow so that they are the width of the widest entry in the table, but I can't find any methods in the cocoa documentation about how to find the widest entry. I looked through NSScrollView, NSTableView, NSView, etc. and found several methods to return the frame but none that return the actual used width.

Anyone know how I can do this?

Thanks,
Chris Struhar

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >auto-sizing NSTableView (From: chris struhar <email@hidden>)

  • Prev by Date: auto-sizing NSTableView
  • Next by Date: TableView cell with image?
  • Previous by thread: auto-sizing NSTableView
  • Next by thread: TableView cell with image?
  • Index(es):
    • Date
    • Thread