Re: Scrollbar doesn't initially update
Re: Scrollbar doesn't initially update
- Subject: Re: Scrollbar doesn't initially update
- From: publiclook <email@hidden>
- Date: Wed, 16 Jul 2003 19:43:56 -0400
On Wednesday, July 16, 2003, at 06:49 PM, Christopher Corbell wrote:
On Tuesday, July 15, 2003, at 03:26 PM, Alastair J.Houghton wrote:
The resizing is invoked automatically by bindings, because the
ultimate container of the NSScrollView is an NSDrawer. The drawer is
resized to match the parent window.
Actually though I think it's not so much the resizing as the
populating of the
table that's failing to update the scroller. (In the nib file the
table doesn't
have any contents, so the scrollbar is rightly invalid in the IB UI).
I've overridden -reloadData and inserted the call that Johness
suggested
(reflectScrolledClipView). This seems to fix it. Too bad NSTableView
doesn't do this automatically (it could just do so if the NSView method
enclosingScrollView returns an object)....
I think this is another example of fighting the frameworks. It should
not be necessary, and I don't think it is, to call
-reflectScrolledClipView when a table is relaoded. The table sizes its
frame to contain all of the rows that the tables data source claims
exist. The scroll view automatically adjusts its scroll bars to match
the frame of its document view.
Here are my guesses:
1) The first time -reloadData is called, the scrollview does not yet
exist. This could happen if -reloadData is called in an
-initWithCoder: method. The fix is to reload data in -awakeFromNib
instead.
2) The table outlet is nil the first time -reloadData is called.
3) the scroll view and or the table view are not in a view hierarchy
rooted by a window when -reloadData is first called.
4) the table's data source is lying about the number of rows available
(perhaps only the first time)
_______________________________________________
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.