chagge / voiceid

Automatically exported from code.google.com/p/voiceid
1 stars 0 forks source link

wxPython recursion overflow #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start from cmd.exe without any arguments.

What is the expected output? What do you see instead?
GUI fails to initialize. Endless loop of "Exception RuntimeError: 'maximum 
recursion depth exceeded'"

What version of the product are you using? On what operating system?
* Windows 7
* Python 2.7.5.6
* wxPython 2.9.5.0

Details
I opened a thread on the wxPython-users mailing list 
@https://groups.google.com/forum/#!topic/wxpython-users/7hA7ZXXMx20. The 
suggestions there fix the problem, though I can't be sure because the UI 
continues to randomly lock-up for short intervals quite often. While this is 
probably a different issue, it means I can't comprehensively test the following 
summarized solutions:

#1: get rid of ClusterList.on_size, use built-in auto-layout
ClusterList.__init__
...     
        #self.Bind(wx.EVT_SIZE, self.on_size)
        #self.info.Bind(wx.EVT_SIZE, self.on_size)
        #self.list.Bind(wx.EVT_SIZE, self.on_size)
...
ClusterList.on_size
    #def on_size(self, event):
    #    """Update layouts on size event"""
    #    self.list.Refresh()
    #    self.list.Layout()
    #    self.info.Refresh()
    #    self.info.Layout()
    #    self.Refresh()
    #    self.Layout()

#2: 
ClusterList.__init__
...
        self.Bind(wx.EVT_SIZE, self.on_size_self)
        self.info.Bind(wx.EVT_SIZE, self.on_size_special)
        self.list.Bind(wx.EVT_SIZE, self.on_size_special)
...
ClusterList.on_size*
    def on_size_self(self, event):
        """Update layouts on size event"""
        self.list.Refresh()
        self.list.Layout()
        self.info.Refresh()
        self.info.Layout()
        self.Refresh()
        self.Layout()
        event.Skip()

    def on_size_special(self, event):
        """Under no circusmtances call self.Layout(), will case *massive* problems"""
        pass

Original issue reported on code.google.com by OrbisVi...@gmail.com on 14 Dec 2013 at 7:46