wxPython sizer troubleshoot, How can I detach?

54 views Asked by At

With a wxpython program, I ran into following situation.

Traceback (most recent call last):
  File "/path/to/a/source.py", line ###, in onChoice
    self.__do_layout(self.GetPosition()[0], self.GetPosition()[1], self.GetSize().GetWidth())
  File "/path/to/a/source.py", line ***, in __do_layout
    sizer_10.Add(self.notebook_1, 1, wx.EXPAND, 0)
wx._core.wxAssertionError: C++ assertion ""!m_containingSizer"" failed at ./src/common/wincmn.cpp(2488) in SetContainingSizer(): Adding a window already in a sizer, detach it first!

So far, I have checked

  1. self.notebook_1 has not been added to other sizers (at line ***)
  2. adding a line "sizer_10.Detach(self.notebook_1)" just before line *** does not help.
  3. nothing has been added to sizer10 at line *** (pycharm says so)

I have no idea about line ###.

This program aborts when run within pycharm, while it does not abort when stand alone, (but buttons and others do not work correct.)

Can any experts give me some hints for next step?

regards

0

There are 0 answers