下面的代碼段填充了一個繼承自類wx.Menu類的菜單項。所以自我基本上是一個wx.Menu。當我運行流動的代碼片段,行about.SetBitmap(wx.Bitmap(「Icon24.ico」))似乎高亮更改默認:影響Windows 7上wxPython中菜單樣式的圖標
這個普通的藍色風格:
線about.SetBitmap(wx.Bitmap( 'Icon24.ico'))只是增加了一個圖標(測試)。但是,由於某種原因,它會改變突出顯示風格。我知道這是關於nitpicky,因爲它是,但我想第一個圖像突出顯示與第二個圖像圖標的風格。這是在Windows 7中,如果它有所作爲。
段:
about = wx.MenuItem(self, -1, 'About...')
about.SetBitmap(wx.Bitmap('Icon24.ico')) # The line that's causing the problem.
itemlist = [self.AppendItem(about),
self.AppendSeparator(),
self.Append(-1, 'Options...'),
self.AppendSeparator(),
self.Append(-1, 'Exit')]
for i in itemlist:
self.Bind(wx.EVT_MENU, self.menu_beh, i)
您正在使用哪個版本的wxWidgets/wxPython? – Terseus 2011-03-10 09:13:31
wxPython版本2.8.11.0,在Python 2.6.5 – rectangletangle 2011-03-10 10:25:03