文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>wxPython bug

wxPython bug

时间:2010-04-06  来源:masonzhang



今天敲code 非常简单的一张图贴不上去 去问Google 大神原来是 bug 3年了还是没有改 服了

http://trac.wxwidgets.org/ticket/4011  bug 这里

how to 这里

This is a confirmed bug which appearently has been open for quite a while. After trying around a little bit, this workaround seems to do it:

   import wx

def getBmp():
bmp = wx.EmptyBitmap(16,16)
return bmp

class MyFrame(wx.Frame):
def __init__(self,parent,id,title):
wx.Frame.__init__(self,parent,id,title)

#======================================加菜单
menuBar = wx.MenuBar()
fileMenu=wx.Menu()
tempitem = fileMenu.Append(-1,"X") # !!!
tempitem.SetBitmap(getBmp()) # !!!
item = fileMenu.Append(wx.ID_NEW, "New")
fileMenu.Remove(tempitem.GetId()) # !!!
item.SetBitmap(getBmp())
item = fileMenu.Append(wx.ID_OPEN, "Open")
item.SetBitmap(getBmp())
item = fileMenu.Append(wx.ID_SAVE, "Save")
item.SetBitmap(getBmp())
menuBar.Append(fileMenu, "File")
self.SetMenuBar(menuBar)





#=====================================stuff

self.SetMenuBar(menuBar)
self.Center()
self.Show()

app = wx.PySimpleApp()
MyFrame(None ,-1,'L5.py')

app.MainLoop()

Note that the position of the fileMenu.Remove call is the earliest position that works, but you can also move it to the bottom. HTH.


这里





相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载