AGW LabelBook not working with wxPython 3.0.x

I am attempting to test the LabelBook from Andrea’s AGW library and keep getting the following traceback. I am also unable to see the LabelBook tabs that should be on the left. The background for the tab area is present and the first tab’s panel loads, but cannot navigate with any navigation keys or the mouse because the tabs themselves are missing.

Traceback (most recent call last):

File “/usr/local/lib/python2.7/dist-packages/wx/lib/agw/labelbook.py”, line 1667, in OnPaint

bmp = self._ImageList.GetBitmap(indx)

File “/usr/local/lib/python2.7/dist-packages/wx/_gdi.py”, line 6743, in GetBitmap

return gdi.ImageList_GetBitmap(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “node” failed at ~/Downloads/wxpython/wxPython-src-3.0.0.0/src/generic/imaglist.cpp(122) in GetBitmapPtr(): wrong index in image

I also tried the same attached code with wxPython_Phoenix-3.0.1.dev76392 with the same results. Any suggestions?

The machine is Ubuntu 12.04 LTS, Python 2.7.6

new_lb_test.py (3.64 KB)

Hi Mike,

I am attempting to test the LabelBook from Andrea's AGW library and keep getting the following traceback. I am also unable to see the LabelBook tabs that should be on the left. The background for the tab area is present and the first tab's panel loads, but cannot navigate with any navigation keys or the mouse because the tabs themselves are missing.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/wx/lib/agw/labelbook.py", line 1667, in OnPaint
    bmp = self._ImageList.GetBitmap(indx)
  File "/usr/local/lib/python2.7/dist-packages/wx/_gdi.py", line 6743, in GetBitmap
    return _gdi_.ImageList_GetBitmap(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "node" failed at ~/Downloads/wxpython/wxPython-src-3.0.0.0/src/generic/imaglist.cpp(122) in GetBitmapPtr(): wrong index in image

I also tried the same attached code with wxPython_Phoenix-3.0.1.dev76392 with the same results. Any suggestions?

The machine is Ubuntu 12.04 LTS, Python 2.7.6

Did a quick try on:

Windows 8, Python 3.3, 3.0.1.dev76380
Windows 8, Python 2.7, 3.0.1.dev76109

Both do not give me the exception you see, however I see this one on closing:
File "D:\devOther\aaSamples\mikeStover\agwlabelbook.py", line 113, in <module>
   Main()
File "D:\devOther\aaSamples\mikeStover\agwlabelbook.py", line 110, in Main
   app.MainLoop()
File "c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\core.py", line 1878, in MainLoop
   rv = wx.PyApp.MainLoop(self)

wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at ..\..\src\common\wincmn.cpp(478) in wxWindowBase::~wxWindowBase(): any pushed event handlers must have been removed

IIRC, Robin is working on this one, I believe something to do with Destroy not being called on aui.

Werner

···

On 4/25/2014 16:52, Mike Stover wrote:

Were you able to see the tabs on the left at all? They wont show for me on my linux machines with wxPython 3.0.x yet they will load on the Win7 machine with wxPython 2.9.5.0 and I have been unable to get 2.9.5.0 to install on the linux machine.

···

On Friday, April 25, 2014 11:34:37 AM UTC-4, werner wrote:

Hi Mike,

On 4/25/2014 16:52, Mike Stover wrote:

I am attempting to test the LabelBook from Andrea’s AGW library and
keep getting the following traceback. I am also unable to see the
LabelBook tabs that should be on the left. The background for the tab
area is present and the first tab’s panel loads, but cannot navigate
with any navigation keys or the mouse because the tabs themselves are
missing.

Traceback (most recent call last):

File
“/usr/local/lib/python2.7/dist-packages/wx/lib/agw/labelbook.py”, line
1667, in OnPaint

bmp = self._ImageList.GetBitmap(indx)

File “/usr/local/lib/python2.7/dist-packages/wx/_gdi.py”, line 6743,
in GetBitmap

return _gdi_.ImageList_GetBitmap(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “node” failed at
~/Downloads/wxpython/wxPython-src-3.0.0.0/src/generic/imaglist.cpp(122) in
GetBitmapPtr(): wrong index in image

I also tried the same attached code
with wxPython_Phoenix-3.0.1.dev76392 with the same results. Any
suggestions?

The machine is Ubuntu 12.04 LTS, Python 2.7.6

Did a quick try on:

Windows 8, Python 3.3, 3.0.1.dev76380

Windows 8, Python 2.7, 3.0.1.dev76109

Both do not give me the exception you see, however I see this one on
closing:

File “D:\devOther\aaSamples\mikeStover\agwlabelbook.py”, line 113, in

Main()

File “D:\devOther\aaSamples\mikeStover\agwlabelbook.py”, line 110, in Main

app.MainLoop()

File “c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\core.py”,
line 1878, in MainLoop

rv = wx.PyApp.MainLoop(self)

wx._core.wxAssertionError: C++ assertion “GetEventHandler() == this”
failed at …..\src\common\wincmn.cpp(478) in
wxWindowBase::~wxWindowBase(): any pushed event handlers must have been
removed

IIRC, Robin is working on this one, I believe something to do with
Destroy not being called on aui.

Werner

Yes, I see Tab 1 - 4 on the left.
Werner

···

On 4/25/2014 18:07, Mike Stover wrote:

Were you able to see the tabs on the left at all? They wont show for me on my linux machines with wxPython 3.0.x yet they will load on the Win7 machine with wxPython 2.9.5.0 and I have been unable to get 2.9.5.0 to install on the linux machine.

Thanks Werner, I guess I will go back to fighting with installing 2.9.5.0 onto Ubuntu 12.04 LTS so that I can finish my GUI since I use it often when I’m not at home.

···

On Friday, April 25, 2014 12:14:57 PM UTC-4, werner wrote:

On 4/25/2014 18:07, Mike Stover wrote:

Were you able to see the tabs on the left at all? They wont show for
me on my linux machines with wxPython 3.0.x yet they will load on the
Win7 machine with wxPython 2.9.5.0 and I have been unable to get
2.9.5.0 to install on the linux machine.

Yes, I see Tab 1 - 4 on the left.

Werner

Hhm, I didn't explicitly state it but the versions I tested with are both Phoenix, you realize that.

Werner

···

On 4/25/2014 18:23, Mike Stover wrote:

Thanks Werner, I guess I will go back to fighting with installing 2.9.5.0 onto Ubuntu 12.04 LTS so that I can finish my GUI since I use it often when I'm not at home.

Yeah, I noticed the version number in the traceback, however I have tested this same script with Phoenix 3.0.1 snapshot dev 76392 and still cannot see the tabs. At least if I can get 2.9.5.0 working on the linux machine I can continue working on the gui.

···

On Friday, April 25, 2014 12:31:25 PM UTC-4, werner wrote:

On 4/25/2014 18:23, Mike Stover wrote:

Thanks Werner, I guess I will go back to fighting with installing
2.9.5.0 onto Ubuntu 12.04 LTS so that I can finish my GUI since I use
it often when I’m not at home.

Hhm, I didn’t explicitly state it but the versions I tested with are
both Phoenix, you realize that.

Werner

Ok, I think something is fubar on my Linux laptop… I got 2.9.5.0 installed, with just about every “extra” I could think of and I am getting the same error. Though now I am also getting a new error that only appears after closing the app…

(new_lb_test.py:4008): Gdk-CRITICAL **: IA__gdk_draw_drawable: assertion `GDK_IS_DRAWABLE (drawable)’ failed

~/wxpython-source/wxPython-src-2.9.5.0/src/gtk/dcclient.cpp(253): assert “Assert failure” failed in wxFreePoolGC(): Wrong GC

Could I be missing a package somewhere?

···

On Friday, April 25, 2014 10:52:09 AM UTC-4, Mike Stover wrote:

I am attempting to test the LabelBook from Andrea’s AGW library and keep getting the following traceback. I am also unable to see the LabelBook tabs that should be on the left. The background for the tab area is present and the first tab’s panel loads, but cannot navigate with any navigation keys or the mouse because the tabs themselves are missing.

Traceback (most recent call last):

File “/usr/local/lib/python2.7/dist-packages/wx/lib/agw/labelbook.py”, line 1667, in OnPaint

bmp = self._ImageList.GetBitmap(indx)

File “/usr/local/lib/python2.7/dist-packages/wx/_gdi.py”, line 6743, in GetBitmap

return gdi.ImageList_GetBitmap(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “node” failed at ~/Downloads/wxpython/wxPython-src-3.0.0.0/src/generic/imaglist.cpp(122) in GetBitmapPtr(): wrong index in image

I also tried the same attached code with wxPython_Phoenix-3.0.1.dev76392 with the same results. Any suggestions?

The machine is Ubuntu 12.04 LTS, Python 2.7.6

I’ve narrowed down the issue a bit. I decided to test the LabelBook demo again and noticed it was not having any issues running on Ubuntu. So I looked at the main differences between its code and my code, which is where I noticed that the demo appends images to the imagelist. So, copied the folder the images were in along with the code to add the images to my code, and voila, it works with no errors! This leads me to believe that I will either want to create a blank transparent image or find a way to override the code that attempts to load images into the tabs.

So far it has been confirmed to work on 2.8.12 through Phoenix 3.0.1 with adding images to imagelist even though they will not be displayed.