[wxpython-users] FlatNotebook

Andrea Gavana andrea.gavana at gmail.com
Wed Apr 2 01:45:02 PDT 2008


Hi Werner,

On Wed, Apr 2, 2008 at 9:37 AM, Werner F. Bruhin wrote:
> I found that it does not support notebook.ChangeSelection  - no big deal as
> SetSelection works for me and the change page event doesn't cause me an
> issue, but it would be nice if it could be added.
>
> I also get an exception if I do this:
>
>           self.notebook1.RemovePage(0)
>           self.vintageDetailsSP.Hide()
>           self.notebook1.InsertPage(0, self.vintageDetails, _(u'Vintage
> Details'), False)
>           self.vintageDetails.Show()
>
>           self.spirinfoDetails.Hide()
>           self.notebook1.RemovePage(1)
>           self.notebook1.InsertPage(1, self.vinificationDetails,
> _("Winemaker's Details"), False)
>
> When I try to change the selection in the GUI I get an exception that window
> can't be added twice to the sizer.
>
> **** Wed Apr 02 10:35:26 2008 **** Version: 2.3.367.9 ****  wxV: 2.8.7.1
> (msw-unicode) *****
> Traceback (most recent call last):
>  File
> "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\flatnotebook.py",
> line 3971, in OnLeftDown
>   self.FireEvent(tabIdx)
>  File
> "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\flatnotebook.py",
> line 4837, in FireEvent
>   self.SetSelection(selection)
>  File
> "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\flatnotebook.py",
> line 4166, in SetSelection
>   book.SetSelection(page)
>  File
> "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\flatnotebook.py",
> line 3295, in SetSelection
>   self._mainSizer.Add(self._windows[page], 1, wx.EXPAND)
>  File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line
> 12479, in Add
>   return _core_.Sizer_Add(*args, **kwargs)
> PyAssertionError: C++ assertion "!sizer || m_containingSizer != sizer"
> failed at ..\..\src\common\wincmn.cpp(1835) in
> wxWindowBase::SetContainingSizer(): Adding a window to the same sizer twice?
>
> Again, I can work around it as I set them both to True, as I anyhow have to
> use SetSelection later on in the code to select the correct page.

Uhm, this looks like a nice bug... let me investigate and I'll update
the source in SVN once I find a solution.

Thank you for the bug report!

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/


More information about the wxpython-users mailing list