Discussion:
long process, feed back widget frozen on Mac
(too old to reply)
Armel
2009-05-26 13:45:36 UTC
Permalink
[wx2.6.3 on Mac]

hello,

I have a wxListCtrl widget which shows statistics on the fly during a long
process, unfortunately it remains frozen until the loop finishes.

basically, the loop looks like this:

while (long_process_runing)
{
listctrl->Freeze();
listctrl->DeletaAllItems();
// insert the new items
listctrl->Thaw();

// added for the mac in the hope of getting a result
listctrl->Refresh();
listctrl->Update();
// end of addition

wxApp::GetInstace()->Yield(true);
}

any idea why it would never refresh until the long work actually ends?

Regards
Armel
--
Vadim Zeitlin
2009-05-26 14:12:45 UTC
Permalink
On Tue, 26 May 2009 15:45:36 +0200 Armel <"armelasselin hotmail.com"@riobu.com> wrote:

A> [wx2.6.3 on Mac]
...
A> basically, the loop looks like this:
A>
A> while (long_process_runing)
A> {
A> listctrl->Freeze();
A> listctrl->DeletaAllItems();
A> // insert the new items
A> listctrl->Thaw();
A>
A> // added for the mac in the hope of getting a result
A> listctrl->Refresh();
A> listctrl->Update();
A> // end of addition
A>
A> wxApp::GetInstace()->Yield(true);
A> }
A>
A> any idea why it would never refresh until the long work actually ends?

Refresh() + Update() should be enough to make it redraw but I honestly
don't know if this works in wxMac 2.6. If you can still reproduce it in the
listctrl sample with wx 2.8 then it would be worth opening a bug for this.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Armel
2009-05-26 14:17:18 UTC
Permalink
On Tue, 26 May 2009 15:45:36 +0200 Armel <"armelasselin
hotmail.com"@riobu.com> wrote:

A> [wx2.6.3 on Mac]
...
A> basically, the loop looks like this:
A>
A> while (long_process_runing)
A> {
A> listctrl->Freeze();
A> listctrl->DeletaAllItems();
A> // insert the new items
A> listctrl->Thaw();
A>
A> // added for the mac in the hope of getting a result
A> listctrl->Refresh();
A> listctrl->Update();
A> // end of addition
A>
A> wxApp::GetInstace()->Yield(true);
A> }
A>
A> any idea why it would never refresh until the long work actually ends?
Post by Vadim Zeitlin
Refresh() + Update() should be enough to make it redraw but I honestly
don't know if this works in wxMac 2.6. If you can still reproduce it in the
listctrl sample with wx 2.8 then it would be worth opening a bug for this.
OK, i'll try to compile wx 2.8 on mac and see the result. this problem is
definitely making the whole dialog box annoying (it just shows to display
nothing until the end of process).
I come back asap with a comment.

Regards
Armel
Armel
2009-05-27 13:21:55 UTC
Permalink
Post by Vadim Zeitlin
On Tue, 26 May 2009 15:45:36 +0200 Armel <"armelasselin
A> [wx2.6.3 on Mac]
...
A>
A> while (long_process_runing)
A> {
A> listctrl->Freeze();
A> listctrl->DeletaAllItems();
A> // insert the new items
A> listctrl->Thaw();
A>
A> // added for the mac in the hope of getting a result
A> listctrl->Refresh();
A> listctrl->Update();
A> // end of addition
A>
A> wxApp::GetInstace()->Yield(true);
A> }
A>
A> any idea why it would never refresh until the long work actually ends?
Post by Vadim Zeitlin
Refresh() + Update() should be enough to make it redraw but I honestly
don't know if this works in wxMac 2.6. If you can still reproduce it in the
listctrl sample with wx 2.8 then it would be worth opening a bug for this.
OK, i'll try to compile wx 2.8 on mac and see the result. this problem is
definitely making the whole dialog box annoying (it just shows to display
nothing until the end of process).
I come back asap with a comment.
the Generic wxListCtrl still has the problem as of downloadable wx 2.8.10,
as it was the default for wxMac 2.6.3 the bug was there. Using the new
default which is native Mac list, it works.

There is also a strange difference between the generic implementation and
the native. It seems DeleteAllItems will get rid of the columns in native
version, whereas generic does not. Should it? [as of wx 2.6.3 it did not
remove the columns, and it seemed rather logical]
The doc says nothing about this.

I can submit the test patch against 2.8.10 (listtest.h/.cpp) if you like.

Regards
Armel
Armel
2009-05-27 13:25:52 UTC
Permalink
Post by Armel
There is also a strange difference between the generic implementation and
the native. It seems DeleteAllItems will get rid of the columns in native
version, whereas generic does not. Should it? [as of wx 2.6.3 it did not
remove the columns, and it seemed rather logical]
The doc says nothing about this.
oops, please disregard this comment, the behaviour is visually different but
the columns are not deleted either so everything is logical.

Armel
Armel
2009-05-27 15:12:20 UTC
Permalink
Post by Armel
Post by Vadim Zeitlin
On Tue, 26 May 2009 15:45:36 +0200 Armel <"armelasselin
A> [wx2.6.3 on Mac]
...
A>
A> while (long_process_runing)
A> {
A> listctrl->Freeze();
A> listctrl->DeletaAllItems();
A> // insert the new items
A> listctrl->Thaw();
A>
A> // added for the mac in the hope of getting a result
A> listctrl->Refresh();
A> listctrl->Update();
A> // end of addition
A>
A> wxApp::GetInstace()->Yield(true);
A> }
A>
A> any idea why it would never refresh until the long work actually ends?
Post by Vadim Zeitlin
Refresh() + Update() should be enough to make it redraw but I honestly
don't know if this works in wxMac 2.6. If you can still reproduce it in the
listctrl sample with wx 2.8 then it would be worth opening a bug for this.
OK, i'll try to compile wx 2.8 on mac and see the result. this problem is
definitely making the whole dialog box annoying (it just shows to display
nothing until the end of process).
I come back asap with a comment.
the Generic wxListCtrl still has the problem as of downloadable wx 2.8.10,
as it was the default for wxMac 2.6.3 the bug was there. Using the new
default which is native Mac list, it works.
There is also a strange difference between the generic implementation and
the native. It seems DeleteAllItems will get rid of the columns in native
version, whereas generic does not. Should it? [as of wx 2.6.3 it did not
remove the columns, and it seemed rather logical]
The doc says nothing about this.
I can submit the test patch against 2.8.10 (listtest.h/.cpp) if you like.
Regards
Armel
from the code I could read in the generic list ctrl, the control waits for
idle message generation to call "RecalculatePositions( )"
thus Update does absolutely nothing... there should be an implementation for
it, calling forcefully RecalculatePositions when the stuff is "m_dirty",
before calling base ::Update implementation

Regards
Armel
Vadim Zeitlin
2009-05-28 09:55:03 UTC
Permalink
On Wed, 27 May 2009 17:12:20 +0200 Armel <"armelasselin hotmail.com"@riobu.com> wrote:

A> from the code I could read in the generic list ctrl, the control waits for
A> idle message generation to call "RecalculatePositions( )"
A> thus Update does absolutely nothing... there should be an implementation for
A> it, calling forcefully RecalculatePositions when the stuff is "m_dirty",
A> before calling base ::Update implementation

Thanks for analysing this, I agree that this looks like a bug and so you
should open a Trac ticker for it or, better yet, make a patch and attach it
to this ticket (if you do this, it would be great to add some code to the
listctrl sample to exercise this functionality, like this we will be able
to test easily that it works in the future).

TIA,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Stefan Csomor
2009-05-26 14:14:15 UTC
Permalink
Hi Armel
Post by Armel
I have a wxListCtrl widget which shows statistics on the fly during a long
process, unfortunately it remains frozen until the loop finishes.
...
Post by Armel
// added for the mac in the hope of getting a result
listctrl->Refresh();
listctrl->Update();
// end of addition
wxApp::GetInstace()->Yield(true);
}
any idea why it would never refresh until the long work actually ends?
against which SDK using which Tools are you compiling this ? and on which
OSX version are you testing this, any chance you could update to 2.8 ?

Best,

Stefan
Loading...