[wxPython] wxFrame.Clear()

wxFrame is derived from wxWindow. wxWindows has a method called
Clear. I derived MyFrame from wxFrame. When I call MyFrame.Clear() I
get:

print self
self.Clear()

<C wxFrame instance at _8087320_wxFrame_p>
AttributeError: MyFrame instance has no attribute 'Clear'

That's strange. Since my class is derived from wxWindow it should have
a Clear() method.

Background: I reload images in a sizer by deleting them from the sizer
and adding them again. Sometimes there are some parts of the old image
left on the screen. That's why I want to clear it.

thomas

···

--
Thomas Guettler <guettli@thomas-guettler.de>
http://www.thomas-guettler.de

wxFrame is derived from wxWindow. wxWindows has a method called
Clear. I derived MyFrame from wxFrame. When I call MyFrame.Clear() I
get:

print self
self.Clear()

<C wxFrame instance at _8087320_wxFrame_p>
AttributeError: MyFrame instance has no attribute 'Clear'

That's strange. Since my class is derived from wxWindow it should have
a Clear() method.

It does here:

Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from wxPython.wx import *
a = wxPySimpleApp()
f = wxFrame(None, -1, "Hello")
f.Clear

<bound method wxFrame.Clear of <C wxFrame instance at _d735e8_wxFrame_p>>

from wxPython import wx
wx.__version__

'2.3.2.1'

wxFrame.Clear

<unbound method wxFrame.Clear>

Background: I reload images in a sizer by deleting them from the sizer
and adding them again. Sometimes there are some parts of the old image
left on the screen. That's why I want to clear it.

It wouldn't work anyway. The frame is the borders around the window and the
area *behind* all the child windows. Your images are in wxStaticBitmaps
which are completely different windows than your frame, you could visualize
them as being in front of the frame. Clearing the frame would do nothing to
the windows in front of it.

···

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