使用ControlPanel类时出现下面的错误:
b = buttons.GenBitmapToggleButton(self, -1, bmp, size=buttonSize)
NameError: global name ‘buttons‘ is not defined
buttons不识别,导入buttons类都不行:
import wx.lib.buttons
后面把buttons改为wx.lib.buttons解决问题:
b = wx.lib.buttons.GenBitmapToggleButton(self, -1, bmp, size=buttonSize)
或者导入的时候
import wx.lib.buttons as buttons