Re: Slight problem with updates in NSTableView
Re: Slight problem with updates in NSTableView
- Subject: Re: Slight problem with updates in NSTableView
- From: Drew McCormack <email@hidden>
- Date: Mon, 22 Oct 2001 15:50:05 +0200
I had something very similar with an NSTextView: it wouldn't update
until the mouse moved over it. I suspect that for whatever reason, the
program is waiting before getting to the end of the event loop, since I
think it does the pending display updates there. So when you call
"displayIfNeeded", it flags the view as needing an update, but it only
carries the update out later.
The only solution I found was the one you suggest, ie, calling "display"
directly.
Drew McCormack
On Monday, October 22, 2001, at 02:58 , j o a r wrote:
Hi,
I have a problem with a workaround, but I'd like to understand why it
works this way.
I have a simple table view where I update one of the column values -
it's a status display that needs to show updated progress.
Whenever I have changed the value I call [myTableView reloadData], but
it doesn't show the updated values unless I manually select that row in
the table view. If I click-click-click in the table view I can "force"
it to display continuously updating values, but if I don't trigger the
redisplay in this way nothing happens.
As far as I know it's not a threading problem, since the process I'm
displaying progress on is running in a separate thread.
The workaround is in my case to tell the window containing the table
view to "display". Should this really be needed? According to the
documentation "reloadData" is supposed to set "setNeedsDisplay:YES" (at
least as far as I can tell).
// This call should suffice
[myTableView reloadData];
// ...especially coupled with these two
// [myTableView setNeedsDisplay:YES];
// [[myTableView window] displayIfNeeded];
// ...but I need to use this instead
[[myTableView window] display];
Are you supposed to "manually" tell the window (or topmost view) every
time you make a change in a subview? And why doesn't "displayIfNeeded"
work when "display" does?
Regards,
j o a r
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
================================
Dr. Drew McCormack
Department of Theoretical Chemistry
Science Faculty
Free University Amsterdam
De Boelelaan 1083
1081 HV Amsterdam
The Netherlands
Email :: email@hidden
Tel. :: +31 20 44 47623
Fax :: +31 20 44 47629