pyAui - freeze/thaw seems not have any effect

I am trying to switch over to AUI and run into the following problem.

I have:

- a wx.frame
    - _aui
       - intro panels

On the intro panels one can select to work with wines or recipes by
clicking on a button.

I do:

- freeze
- hide and destroy intro panel
- import either wine or recipe stuff
- AddPane etc
- thaw
- aui.Update()

The problem is that when the import happens (which in turn is a panel
with AUI and two notebooks with about 10 tabs - so a bit slow) I see the
creation of the wine/recipe stuff, as if an empty panel is shown.

Any suggestions on what I can do that either freeze is respected or ....?

Werner

Hi Werner,

I am trying to switch over to AUI and run into the following problem.

I have:

- a wx.frame
- _aui
- intro panels

On the intro panels one can select to work with wines or recipes by
clicking on a button.

I do:

- freeze
- hide and destroy intro panel
- import either wine or recipe stuff
- AddPane etc
- thaw
- aui.Update()

The problem is that when the import happens (which in turn is a panel
with AUI and two notebooks with about 10 tabs - so a bit slow) I see the
creation of the wine/recipe stuff, as if an empty panel is shown.

Any suggestions on what I can do that either freeze is respected or ....?

Do you mean you can see a small rectangle on the top left of your app
while the creation is going on? Does it happen with wxAUI as well? I
also have a big application which loads tabs and the process may
sometimes be slowish, and on Windows XP I can see the creation stuff
on the top left of my frame. This happens with wxAUI and with AUI
indifferently for me.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Mon, Apr 27, 2009 at 10:33 AM, Werner F. Bruhin wrote:

Werner F. Bruhin schrieb:

···

I am trying to switch over to AUI and run into the following problem.

I have:

- a wx.frame
   - _aui
      - intro panels

On the intro panels one can select to work with wines or recipes by
clicking on a button.

I do:

- freeze
- hide and destroy intro panel
- import either wine or recipe stuff
- AddPane etc
- thaw
- aui.Update()

The problem is that when the import happens (which in turn is a panel
with AUI and two notebooks with about 10 tabs - so a bit slow) I see the
creation of the wine/recipe stuff, as if an empty panel is shown.

Any suggestions on what I can do that either freeze is respected or ....?

Werner

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi Andrea,

Andrea Gavana wrote:

Hi Werner,

I am trying to switch over to AUI and run into the following problem.

I have:

- a wx.frame
  - _aui
     - intro panels

On the intro panels one can select to work with wines or recipes by
clicking on a button.

I do:

- freeze
- hide and destroy intro panel
- import either wine or recipe stuff
- AddPane etc
- thaw
- aui.Update()

The problem is that when the import happens (which in turn is a panel
with AUI and two notebooks with about 10 tabs - so a bit slow) I see the
creation of the wine/recipe stuff, as if an empty panel is shown.

Any suggestions on what I can do that either freeze is respected or ....?
    
Do you mean you can see a small rectangle on the top left of your app
while the creation is going on? Does it happen with wxAUI as well? I
also have a big application which loads tabs and the process may
sometimes be slowish, and on Windows XP I can see the creation stuff
on the top left of my frame. This happens with wxAUI and with AUI
indifferently for me.
  

Have not tried it with wxAUI. Will try to give this a go later today.

I tried to do a screen capture but I can't (using Irfanview).

What I see is a small square in the top left quarter of my application frame and from there all the way down to the bottom left I see like an outline of a panel which overlapps the intro panel stuff (which is what I like to show, probably with some additional information on what is going on e.g. loading page 1, loading page 2 etc).

Werner

···

On Mon, Apr 27, 2009 at 10:33 AM, Werner F. Bruhin wrote:

Hi Andrea,

Andrea Gavana wrote:

...

This happens with wxAUI and with AUI
indifferently for me.
  

Yeap, it happens with wxAUI too - so you mean you have copied the bug from the C++ code :slight_smile: .

Hopefully Robin can shed some light why the wx.Freeze()/wx.Thaw() call does not prevent this to show.

Werner

Hi Werner,

Hi Andrea,

Andrea Gavana wrote:

...

This happens with wxAUI and with AUI
indifferently for me.

Yeap, it happens with wxAUI too - so you mean you have copied the bug from
the C++ code :slight_smile: .

It may be a bug in AUI/wxAUI and, if this is the case, I'll try to
hunt it down. However, my opinion is that Freeze and Thaw are still
broken on Windows. My understanding of how Freeze and Thaw should work
is that, between the call to Freeze and the call to Thaw no drawing,
no painting, no visible layouting, no glitches, no nothing should be
visible in the client area of the window for which I have called
Freeze and Thaw. If my understanding is correct, then Freeze and Thaw
are broken. Otherwise, please someone more knowledgeable correct me...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Mon, Apr 27, 2009 at 12:42 PM, Werner F. Bruhin wrote:

Hi Andrea,

Andrea Gavana wrote:

Hi Werner,

Hi Andrea,

Andrea Gavana wrote:

...
    

This happens with wxAUI and with AUI
indifferently for me.

Yeap, it happens with wxAUI too - so you mean you have copied the bug from
the C++ code :slight_smile: .
    
It may be a bug in AUI/wxAUI and, if this is the case, I'll try to
hunt it down. However, my opinion is that Freeze and Thaw are still
broken on Windows. My understanding of how Freeze and Thaw should work
is that, between the call to Freeze and the call to Thaw no drawing,
no painting, no visible layouting, no glitches, no nothing should be
visible in the client area of the window for which I have called
Freeze and Thaw. If my understanding is correct, then Freeze and Thaw
are broken. Otherwise, please someone more knowledgeable correct me...
  

I tend to agree that it is an issue with Freeze/Thaw.

Adding an additional freeze/thaw to my panel which contains the wine application (which is/has another pyAUI in it) I got rid of the small square, however still have two empty "panels" showing which shouldn't. And I can not find them using the inspection tool and/or setting a strange background color to the ones I suspected - still chasing.

Werner

···

On Mon, Apr 27, 2009 at 12:42 PM, Werner F. Bruhin wrote:
Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

That's my opinion as well. I've tried as many placements of Freeze and Thaw in one of my applications that I could think of, and some painting and layout work still occurs.

Bob

···

At 08:13 AM 4/27/2009, Andrea Gavana wrote:

... my opinion is that Freeze and Thaw are still
broken on Windows. My understanding of how Freeze and Thaw should work
is that, between the call to Freeze and the call to Thaw no drawing,
no painting, no visible layouting, no glitches, no nothing should be
visible in the client area of the window for which I have called
Freeze and Thaw. If my understanding is correct, then Freeze and Thaw
are broken. Otherwise, please someone more knowledgeable correct me...

Andrea.

Same for me. Tried to freeze everything I could get my hands on and I still have a panel which you can see being created (especially if the machine is under heavy load or just slow).

-Matthias

···

Am 27.04.2009, 16:00 Uhr, schrieb Bob Klahn <bobstones@comcast.net>:

At 08:13 AM 4/27/2009, Andrea Gavana wrote:

... my opinion is that Freeze and Thaw are still
broken on Windows. My understanding of how Freeze and Thaw should work
is that, between the call to Freeze and the call to Thaw no drawing,
no painting, no visible layouting, no glitches, no nothing should be
visible in the client area of the window for which I have called
Freeze and Thaw. If my understanding is correct, then Freeze and Thaw
are broken. Otherwise, please someone more knowledgeable correct me...

Andrea.

That's my opinion as well. I've tried as many placements of Freeze and Thaw in one of my applications that I could think of, and some painting and layout work still occurs.

Andrea Gavana wrote:

Hi Werner,

Hi Andrea,

Andrea Gavana wrote:

...

This happens with wxAUI and with AUI
indifferently for me.

Yeap, it happens with wxAUI too - so you mean you have copied the bug from
the C++ code :slight_smile: .

It may be a bug in AUI/wxAUI and, if this is the case, I'll try to
hunt it down. However, my opinion is that Freeze and Thaw are still
broken on Windows. My understanding of how Freeze and Thaw should work
is that, between the call to Freeze and the call to Thaw no drawing,
no painting, no visible layouting, no glitches, no nothing should be
visible in the client area of the window for which I have called
Freeze and Thaw. If my understanding is correct, then Freeze and Thaw
are broken. Otherwise, please someone more knowledgeable correct me...

My guess is that nothing special is being done for new windows that are created with frozen parents, and so they end up being seen even though the parent is frozen. One way to work around that is to create the new windows hidden, which I think is able to be done using 2-phase create like this:

  p = wx.PrePanel()
  p.Hide()
  p.Create(parent, ...)

Then do p.Show() later when you are ready to thaw everything.

I agree though that it would make sense that a new widget created with a frozen parent should start out in a frozen state. Please enter a bug report about that.

···

On Mon, Apr 27, 2009 at 12:42 PM, Werner F. Bruhin wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin & All,

···

On Mon, Apr 27, 2009 at 11:43 PM, Robin Dunn wrote:

Andrea Gavana wrote:

It may be a bug in AUI/wxAUI and, if this is the case, I'll try to
hunt it down. However, my opinion is that Freeze and Thaw are still
broken on Windows. My understanding of how Freeze and Thaw should work
is that, between the call to Freeze and the call to Thaw no drawing,
no painting, no visible layouting, no glitches, no nothing should be
visible in the client area of the window for which I have called
Freeze and Thaw. If my understanding is correct, then Freeze and Thaw
are broken. Otherwise, please someone more knowledgeable correct me...

My guess is that nothing special is being done for new windows that are
created with frozen parents, and so they end up being seen even though the
parent is frozen. One way to work around that is to create the new windows
hidden, which I think is able to be done using 2-phase create like this:

   p = wx\.PrePanel\(\)
   p\.Hide\(\)
   p\.Create\(parent, \.\.\.\)

Then do p.Show() later when you are ready to thaw everything.

I agree though that it would make sense that a new widget created with a
frozen parent should start out in a frozen state. Please enter a bug report
about that.

Done, ticket 10748 here:

http://trac.wxwidgets.org/ticket/10748

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

This is a 9 month old thread, but it seems the baby has not been
delivered yet, so I wanted to add my experience from this week:

It may be a bug in AUI/wxAUI and, if this is the case, I'll try to
hunt it down. However, my opinion is that Freeze and Thaw are still
broken on Windows.

The point of my email now is to report that Freeze/Thaw *is* working
for me on Windows (XP) but *not* working on Linux (Ubuntu).

Specifically, I am seeing the same classic "little square"--the same
one that Werner and others report in this thread--in the upper left
hand corner of the frame during the process of creating a matplotlib
graph and inserting it into an AUI notebook (the regular one, not
Andrea's, which I haven't yet switched to).

On Windows, I call Freeze() on the whole frame prior to the creation
of the graph and adding of the page to the notebook, and then Thaw()
and it the square aint there. But on Ubuntu Linux, it is, and I've
tried (I think) every trick I can, including using CallAfter(),
calling it on the parent of the notebook, the notebook itself, the
frame, etc. Every time, the little square.

My understanding of how Freeze and Thaw should work
is that, between the call to Freeze and the call to Thaw no drawing,
no painting, no visible layouting, no glitches, no nothing should be
visible in the client area of the window for which I have called
Freeze and Thaw.

That's my understanding, too, and certainly my wish. I feel a truly
totalitarian Freeze/Thaw (that as Andrea said, truly nothing is
changed visually) is such an important element of GUI programming if
you want things to look professional and non-buggy. Watching it put
show this small mangled-looking box in the corner for about 500 ms is
rather off-putting.

For some reason, the wx Trac site is not loading, but I checked
yesterday and this bug is still outstanding. On Trac it is reported
as being an MSW-only bug, but I'm clearly seeing it on Ubuntu Linux
and there is another post to this list about someone seeing it with
Xubuntu. I will try to amend that bug report to include GTK, then.

Also: Back in late April 2009, Robin suggested:

One way to work around that is to create the new windows
hidden, which I think is able to be done using 2-phase create like this:

   p = wx\.PrePanel\(\)
   p\.Hide\(\)
   p\.Create\(parent, \.\.\.\)

Then do p.Show() later when you are ready to thaw everything.

This sounds promising, but I am having trouble figuring out how to do
it. I have a PlotPanel class that is a wx.Panel subclass to serve to
display a matplotlib canvas. I import this and use it within the
notebook. So if I want to use this wx.PrePanel approach with an
already made custom subclass, how would I do that? Would the idea be
that I make the PlotPanel class in the imported module actually a
PrePanel? (Haven't had a chance today to try it yet).

Thanks,
Che

···

On Tue, Apr 28, 2009 at 3:14 AM, Andrea Gavana wrote:

After a quick peek in the source it appears that the only widget that has an implementation of Freeze on wxGTK is wxTextCtrl.

···

On 1/27/10 10:51 AM, C M wrote:

This is a 9 month old thread, but it seems the baby has not been
delivered yet, so I wanted to add my experience from this week:

On Tue, Apr 28, 2009 at 3:14 AM, Andrea Gavana wrote:

It may be a bug in AUI/wxAUI and, if this is the case, I'll try to
hunt it down. However, my opinion is that Freeze and Thaw are still
broken on Windows.

The point of my email now is to report that Freeze/Thaw *is* working
for me on Windows (XP) but *not* working on Linux (Ubuntu).

--
Robin Dunn
Software Craftsman

Sorry to intrude, but if that's the case, what's the recommended
approach to "fight" flickering on wxGTK? :slight_smile:
(I have an application where I need to add/remove elements
dynamically, based on user selection)

Thanks!

···

On 28 Gen, 20:48, Robin Dunn <ro...@alldunn.com> wrote:

> The point of my email now is to report that Freeze/Thaw*is* working
> for me on Windows (XP) but *not* working on Linux (Ubuntu).

After a quick peek in the source it appears that the only widget that
has an implementation of Freeze on wxGTK is wxTextCtrl.

Most of the time it's not needed as GTK is double buffered by default so it doesn't have the same problems that Windows has with window updates. Apparent flicker can still happen though if you do things like call Refresh or do a Yield before new widgets have been sized and positioned, or etc. If you can narrow it down to a simple example we can probably get one of the wxGTK guys to look at it.

···

On 2/9/10 7:40 AM, Joril wrote:

On 28 Gen, 20:48, Robin Dunn<ro...@alldunn.com> wrote:

The point of my email now is to report that Freeze/Thaw*is* working
for me on Windows (XP) but *not* working on Linux (Ubuntu).

After a quick peek in the source it appears that the only widget that
has an implementation of Freeze on wxGTK is wxTextCtrl.

Sorry to intrude, but if that's the case, what's the recommended
approach to "fight" flickering on wxGTK? :slight_smile:
(I have an application where I need to add/remove elements
dynamically, based on user selection)

--
Robin Dunn
Software Craftsman