Hello,
I’m trying to set the images for a toolbook layout. I’ve made my own images.py file by feeding my PNG files into img2py.py. I also tried coverting the files to .bmp and then feeding them into encode_bitmaps.py. Both times I got the following error message:
File “mytoolbook.py”, line 82, in main
frame = MainFrame(None, -1, ‘Title’, (600,400))
File “mytoolbook.py”, line 37, in init
tb.AddPage(pgOne, “PageOne”)
File “/usr/lib/python2.7/wx/_core.py”, line 13619, in AddPage
return core.BookCtrlBase_AddPage(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion “bitmap.IsOk()” failed at /home/mttp/cwc/wxPython-src-3.0.0.0/src/gtk/toolbar.cpp(261) in SetImage(): invalid bitmap for wxToolBar icon
Hello,
I’m trying to set the images for a toolbook layout. I’ve made my own images.py file by feeding my PNG files into img2py.py. I also tried coverting the files to .bmp and then feeding them into encode_bitmaps.py. Both times I got the following error message:
File “mytoolbook.py”, line 82, in main
frame = MainFrame(None, -1, ‘Title’, (600,400))
File “mytoolbook.py”, line 37, in init
tb.AddPage(pgOne, “PageOne”)
File “/usr/lib/python2.7/wx/_core.py”, line 13619, in AddPage
return core.BookCtrlBase_AddPage(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion “bitmap.IsOk()” failed at /home/mttp/cwc/wxPython-src-3.0.0.0/src/gtk/toolbar.cpp(261) in SetImage(): invalid bitmap for wxToolBar icon
Hello,
I'm trying to set the images for a toolbook layout. I've made my own
images.py file by feeding my PNG files into img2py.py. I also tried
coverting the files to .bmp and then feeding them into
encode_bitmaps.py. Both times I got the following error message:
File "mytoolbook.py", line 82, in main
frame = MainFrame(None, -1, 'Title', (600,400))
File "mytoolbook.py", line 37, in __init__
tb.AddPage(pgOne, "PageOne")
File "/usr/lib/python2.7/wx/_core.py", line 13619, in AddPage
return _core_.BookCtrlBase_AddPage(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "bitmap.IsOk()" failed at
/home/mttp/cwc/wxPython-src-3.0.0.0/src/gtk/toolbar.cpp(261) in
SetImage(): invalid bitmap for wxToolBar icon
Is there something simple I'm missing here?
You can verify if the bitmaps are valid after you fetch them with GetBitmap by using IsOk(). If it's false there then make sure that there wasn't a problem with the img2py step. You'll also want to make sure that they are all the right size.