wxPython gotchas 
Author Message
 wxPython gotchas

I've just started experimenting with wxPython, and up till now have been
very impressed.  _Much_ easier than tkinter.

Has anyone found any {*filter*} 'gotchas' I should look out for?

Rob



Mon, 14 Feb 2005 11:20:33 GMT  
 wxPython gotchas

Quote:

> I've just started experimenting with wxPython, and up till now have been
> very impressed.  _Much_ easier than tkinter.

> Has anyone found any {*filter*} 'gotchas' I should look out for?

There is one thing I found, but it is specific to Windows and MDI.
If you use MDIChildFrames, have more than one child frame on screen,
and maximize one, and then attempt to close the frame while it is
maximized, wxPython/wxWindows crashes.

Turns out this only happens if the frame is set to AutoLayout, or are
specifying an OnSize method and calling Layout there (basically, if
you have a control that resizes itself).  It seems that what happens
is a size event is sent AFTER the window has been closed, which is the
cause of the problem.

The workaround I use is to define OnSize and OnClose handlers like
this:

    def OnSize(self, event):
        if not self.closed:
            event.Skip()

    def OnClose(self, event):
        event.Skip()
        self.closed = 1

Aside from this, I've been using wxPython on Windows for over a year
and have had very few problems.



Tue, 15 Feb 2005 01:20:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Most annoying Java gotchas

2. IFC Gotchas.

3. Modul gotchas:)

4. Win32Com: VB5 COM server gotchas

5. wxPython looses function "wxPython.wx.miscc"

6. FORTRAN "gotchas", and how to aviod them

7. wxPython 2.4.1.2

8. ANNOUNCE: wxPython 2.4.0.5

9. ANN: wxPython 2.4.0.2

10. ANN: wxPython 2.4.0.1

11. ANN: pyrcconv - converts Win32 .rc files to wxPython sourcecode

12. ANNOUNCE: wxPython 2.3.3.1

 

 
Powered by phpBB® Forum Software