title: wxPython window randomly freezes on RPi and acts weird afterwards
body: <p><em>This Problem occurs on the RPi (3B+, Raspbian Buster) only. I run the program on my Mac without any problems.</em></p>
  
  <p><strong>Short description of my program:</strong></p>
  
  <p>After entering the mainloop, the program enters a second thread with another loop (call it requestloop) when the designated button is pressed. The requestloop can be left by pressing the button again. This requestloop requests a xml table via url every 10 seconds which is then parsed with ElementTree, sorted and displayed in a wx.grid.Grid. I use grid.ForceRefresh to make sure the grid is updated.</p>
  
  <p>I hope the following snippet helps to understand the above:</p>
  
  <pre><code>    def on_btnrun(self, event):
          global run
          if self.btnrun.Label == "Start":
              run = True
              thrupt = threading.Thread(target=self.thrupdate)
              thrupt.start()
              self.btnrun.SetLabel("Ende")
  
          elif self.btnrun.Label == "Ende":
              run = False
              self.btnrun.SetLabel("Start")
  
  
       def thrupdate(self):
           while run is True:
              reset()
              self.grid.ClearGrid()
              update(self.grid)
              self.grid.ForceRefresh()
              time.sleep(10)
  </code></pre>
  
  <p><strong>Problem:</strong></p>
  
  <p>Now as mentioned in the title the whole wx Window freezes after passing the requestloop between roughly 5 and 20 times. This happens completely randomly, I could not find any regularities. The program keeps running though, for it still prints the output in the terminal every cycle (I added this function for testing).
  When I now open another window (eg. menu dropwdown) which lays over the wx Window it will be copied onto the wx Window and stay there after I closed it.</p>
  
  <p>Here are some Images to better understand what I mean (ignore all other widgets that I didn't mention, they are just nonfunctional placeholders).</p>
  
  <p><a href="https://i.stack.imgur.com/BzzSu.png" rel="nofollow noreferrer">Image of the wx Window before it freezes</a></p>
  
  <p><a href="https://i.stack.imgur.com/ryOPU.png" rel="nofollow noreferrer">Image of the wx Window after it freezes</a></p>
  
  <p><a href="https://i.stack.imgur.com/oan4A.png" rel="nofollow noreferrer">Image of the wx Window after opening and closing the dropdown menu</a></p>
  
  <p><strong>Extra-Info</strong>: while building wxPython on the RPi I got some warnings and everytime I run the program I get the following one (it says the actual time instead of time):</p>
  
  <p><code>(program.py:1666): Gtk-Critical **: time: gtk_distribute_natural_allocation: assertion ‚extra_space &gt;= 0‘ failed</code></p>
  
  <p><strong>Question:</strong></p>
  
  <p>I have no idea why any of this happens. Is wxPython not stable on Raspbian? Or did the build partly fail? Or is the RPi not having enough rendering capacity?</p>