TreeView bug?


#1

In my app the user can resize a TreeView horizontally by dragging the mouse on some resizer. On Mac, when I move the mouse really fast from left to right, the content of the TreeView seems not to be repainted correctly.

Example: TreeView is 100 pixels width. I resize it very fast to 500 pixels width and the contents of the TreeView still stay 100 pixels wide. The vertical scrollbar of the TreeView is repositioned correctly. When I move the mouse slowly there is now problem.

When I modify TreeView a little bit like this, then it all works.

void TreeView::itemsChanged() throw() { needsRecalculating = true; repaint(); handleAsyncUpdate(); }


#2

How bizarre… But I’m not sure I trust your fix, because it must depend on the order of repaint and update messages in the message queue being in the right order - how about this instead:

[code]void TreeView::itemsChanged() throw()
{
needsRecalculating = true;
triggerAsyncUpdate();
}

void TreeView::handleAsyncUpdate()
{
if (needsRecalculating)
{
repaint();
needsRecalculating = false;

[/code]


#3

Your proposed fix does still not work for me… Same as the original TreeView code.


#4

Ok, I think I see what’s going on. Your fix looks fine to me then, cheers.


#5

Thanks! I’ve also had the same problem, so I expect this fix will be soon committed to SVN. :slight_smile:


#6

checked it in a while ago, I think.


#7

I’ll try it. Thanks! :smiley: