简体   繁体   中英

genbitmaptextbutton doesn't work on windows 7

I try code from Another Tutorial http://wiki.wxpython.org/AnotherTutorial#Bitmap_Text_Buttons

But it doesn't run on wxpython 2.8.12.1 and python 2.6, i've got this errors:

File "C:\\Python26\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx_core.py", line 3473 , in ImageFromBitmap val = core .new_ImageFromBitmap(*args, **kwargs) wx._core.PyAssertionError: C++ assertion "bmp.Ok()" failed at ....\\src\\msw\\dib. cpp(148) in wxDIB::Create(): wxDIB::Create(): invalid bitmap

Thx for any help.

I suspect your bitmaps are not in the correct locations. Are you providing the "email.png", "calendar.png" and so on images? If yes, are you sure you are passing their correct path to the wx.Bitmap constructor?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM