• 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: NSTableView corrupts the last column
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView corrupts the last column


  • Subject: Re: NSTableView corrupts the last column
  • From: Devin Lane <email@hidden>
  • Date: Sun, 19 Oct 2003 17:43:01 -0700

John

Ah, I see now. At first, I misunderstood what you wanted. I think the trick is to actually create another column to the right of the columns you actually have data for. The only thing you have to implement now is tableView:shouldSelectTableColumn: and return NO for the extra column. Make sure to turn off Autoresizes Columns to Fit.

Hopefully, that is what you are looking for. Otherwise, I think you will have to implement some custom resizing code :(


-- Devin Lane, Cocoa Programmer
email: email@hidden
On Oct 19, 2003, at 5:16 PM, John Nairn wrote:

Devin,

Thanks for the input. Your idea would help but only if I can not do what I really want to do. I am trying to write a better question for the discussion group, but basically I want my interface to be like the list view in Apple's finder (so it really must be possible?). In that view the last column does not change size when a window is resized. It ONLY changes if you drag a line between columns in the table header. If I could accomplish the same it would be great, but nothing I have tried can do it.

My application will create these tables programmatically in response to user settings for numbers of columns, information for each columns, and the width of each column, etc.. I assume I could set a minimum or maximum size as you suggested programmatically, but I have no way of knowing in advance what each user will want. The real answer is the interface I want (like Apple's Finder), but I do not seem to be able to accomplish it with NSTableView.

If you have an other ideas, I would like to hear. I may also post a new questions soon after trying a few things in a mini projects that duplicates all the problems. For example, I set the table in Interface Builder to NOT allow resizing of columns at all and the last column still resizes due to window changes (and posts all resizing notifications). This example sounds like a bug in NSTableView to me. In my opinion resizing the window should never resize the column sizes unless you want all columns to be sized to fit the window. I want to allow the table to be larger than the window.

On Saturday, October 18, 2003, at 08:27 PM, Devin Lane wrote:

John

You can set limits to the size of table columns. Just go into IB, and click till the table column is selected. Then switch to the size inspector, and set a minimum or maximum. Now, when you resize, the last column will not get so small. Also, make sure to turn on the "Autoresize Table Columns" option for the table view.


-- Devin Lane, Cocoa Programmer
email: email@hidden
On Oct 15, 2003, at 8:23 AM, John Nairn wrote:

I have NSTableView in right half of split view. All works fine, but
whenever the window is resized or the split view is resized and the
last column is visible, the NSTableView automatically resizes the last
column to fill all remaining space. It continuously posts
NSTableViewColumnDidResizeNotification's during the size change. This
behavior leads to two bad problems:

1. When reducing the window size the size of the last column shrinks
down to a few pixels. It can no longer be viewed by scrolling and I
have to scroll to edge and then enlarge the window (which resizes the
oclumn again) to see it all (i.e., it takes two annoying steps to
reveal it again).

2. If I manually reduce the last column, sometimes (but not always) it
will be left alone but then the table header cells do not draw
correctly. They draw OK over actual columns but there is ugly white gap
between last table cell end scroll bars.

Perhaps this is planned NSTableView behavior, but in my opinion, the
user should decide when to resize columns by deliberately resizing or
dragging of columns; resizing windows or split panes should not lead to
unexpected column size changes. I suspect Apple agrees because the
NSTableView in the Finder's List View works exactly as I want my table
to work. The last column size stays the way you set it no matter how
you resize the window. You change its size by the proper method
dragging columns.

How can I make the columns in my table work like the table in Finder's
list view? I would think that would be the default behavior?

----------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page: http://www.mse.utah.edu/~nairn
_______________________________________________
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.



----------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page: http://www.mse.utah.edu/~nairn
_______________________________________________
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: Re: NSArray/MutableArray subclass/extension
  • Next by Date: WebKit for WYSIWYG HTML editor?
  • Previous by thread: NSTableView corrupts the last column
  • Next by thread: Re: NSTableView corrupts the last column
  • Index(es):
    • Date
    • Thread