• 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: horizontal scrolling and NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: horizontal scrolling and NSTableView


  • Subject: Re: horizontal scrolling and NSTableView
  • From: Brian Webster <email@hidden>
  • Date: Mon, 6 May 2002 09:01:21 -0500

On Monday, May 6, 2002, at 07:34 AM, cocoa-dev-
email@hidden wrote:

I set up a simple window that contains a three column table using
NSTableView and the default vertical and horizontal scrolling.
Column three, the rightmost column, can be very wide since it
contains path names. Vertical scrolling works fine but horizontal
scrolling doesn't. The horizontal scroll bar doesn't appear until
only five characters of the third column are visible, and even then
it's impossible to scroll more than a small fraction of the column
into view. Any suggestions on how to fix this?

The horizontal scroll bar are determined by the width of the columns of your table view. Note that the width of your columns doesn't automatically expand to fit whatever text you put in it, so even though you have a very long path name in one of your columns, it still retains its same size and won't change the scrollbar. You can use NSTableColumn's setWidth: method to change the size of the column manually whenever the data changes. You can use -[NSString sizeWithAttributes:] to get the size of a string being displayed. If you're not changing any text attributes, passing in an empty NSDictionary should work OK for that method (I'm pretty sure it will just use the default attributes in that case).

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: handling clicks in custom matrix's cells bis
  • Next by Date: REPOST: Lossless PDF scaling
  • Previous by thread: horizontal scrolling and NSTableView
  • Next by thread: Re: Cross platform Obj-C
  • Index(es):
    • Date
    • Thread