"Tearing" due to Freeze/Thaw

Hi All,

I've narrowed down my "tearing" problem further. It's the freeze/thaw
functionality that I added recently to fix some flickering while adding
Notebook pages. The following code puts up a frame and prints 'KeyDown' in
the console everytime a key is pressed. If the GUI frame is positioned so
that it overlaps the console (as shown below) it will tear up into the
console when 'f' is pressed -- 'f' does the print while frozen, all other
keypresses are unfrozen. It's as if the portion of the GUI overlapping the
text area of the console being updated is dragged with the console as it
scrolls.

···

+----------------------+
        > KeyDown |
    +-------+Down |
    > >Down (console) |
    > GUI |Down |
    > >Down |
    +-------+Down |
        > KeyDown |
        > KeyDown |
        +----------------------+

Can anyone shed any light on what is occuring here? Is Freeze to be
avoided, or does it have known caveats?

Thanks,

Steven

#! env python

from wxPython.wx import *

class main_window(wxFrame):

    def __init__(self, parent):

        wxFrame.__init__(self, parent, -1, 'test', size = (500, 500))

        self.Bind(EVT_KEY_DOWN, self.OnKeyDown)

        self.Show(True)

    def OnKeyDown(self, event):

        if event.KeyCode() == 70: # freeze on 'f'
            self.Freeze()

        print 'KeyDown'

        if event.KeyCode() == 70: # freeze on 'f'
            self.Thaw()

class App(wxApp):
    def OnInit(self):
        frame = main_window(None)
        self.SetTopWindow(frame)
        return True

app = App(0)
app.MainLoop()

________________________________

From: Steven Reddie [mailto:smr@essemer.com.au]
Sent: Sunday, 14 August 2005 12:57 AM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] "Tearing" on Windows with console behind GUI

Hi,

I've got a wxPython frame which contains a Notebook. I've got F2 bound to
adding a new page to the notebook and selecting the new page, which
obviously involves some redraws. If I have a Command Prompt window behind
the GUI with writes in the console which involve newlines (ie. the content
of the console is scrolled up a line) as I press F2, I get some "tearing" on
the display. My GUI seems to get caught up in the scrolling of the console
causing part of my GUI to actually scroll up and out of the frame.

Anyone got any idea about what's going on here? I've tried the wxWidgets
widgets.exe sample app and it doesn't exhibit the same problem.

Regards,

Steven

Forget it; it's something wrong with my system, probably the video driver.
I wrote a simple Win32 test (ie. Non-wxWindows/Widgets/Python) which used
the WM_SETREDRAW as wx does, and I get the same problem on my system but not
on another.

···

-----Original Message-----
From: Steven Reddie [mailto:smr@essemer.com.au]
Sent: Monday, 15 August 2005 12:08 PM
To: wxPython-users@lists.wxwidgets.org
Subject: RE: [wxPython-users] "Tearing" due to Freeze/Thaw

Hi All,

I've narrowed down my "tearing" problem further. It's the freeze/thaw
functionality that I added recently to fix some flickering while adding
Notebook pages. The following code puts up a frame and prints 'KeyDown' in
the console everytime a key is pressed. If the GUI frame is positioned so
that it overlaps the console (as shown below) it will tear up into the
console when 'f' is pressed -- 'f' does the print while frozen, all other
keypresses are unfrozen. It's as if the portion of the GUI overlapping the
text area of the console being updated is dragged with the console as it
scrolls.

        +----------------------+
        > KeyDown |
    +-------+Down |
    > >Down (console) |
    > GUI |Down |
    > >Down |
    +-------+Down |
        > KeyDown |
        > KeyDown |
        +----------------------+

Can anyone shed any light on what is occuring here? Is Freeze to be
avoided, or does it have known caveats?

Thanks,

Steven

#! env python

from wxPython.wx import *

class main_window(wxFrame):

    def __init__(self, parent):

        wxFrame.__init__(self, parent, -1, 'test', size = (500, 500))

        self.Bind(EVT_KEY_DOWN, self.OnKeyDown)

        self.Show(True)

    def OnKeyDown(self, event):

        if event.KeyCode() == 70: # freeze on 'f'
            self.Freeze()

        print 'KeyDown'

        if event.KeyCode() == 70: # freeze on 'f'
            self.Thaw()

class App(wxApp):
    def OnInit(self):
        frame = main_window(None)
        self.SetTopWindow(frame)
        return True

app = App(0)
app.MainLoop()

________________________________

From: Steven Reddie [mailto:smr@essemer.com.au]
Sent: Sunday, 14 August 2005 12:57 AM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] "Tearing" on Windows with console behind GUI

Hi,

I've got a wxPython frame which contains a Notebook. I've got F2 bound to
adding a new page to the notebook and selecting the new page, which
obviously involves some redraws. If I have a Command Prompt window behind
the GUI with writes in the console which involve newlines (ie. the content
of the console is scrolled up a line) as I press F2, I get some "tearing" on
the display. My GUI seems to get caught up in the scrolling of the console
causing part of my GUI to actually scroll up and out of the frame.

Anyone got any idea about what's going on here? I've tried the wxWidgets
widgets.exe sample app and it doesn't exhibit the same problem.

Regards,

Steven

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org