Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8827

Re: wx MenuItem - icon is missing

Subject Re: wx MenuItem - icon is missing
From Philip Semanchuk <philip@semanchuk.com>
Date 2011-07-05 08:50 -0400
References <4E12C505.3020300@shopzeus.com>
Newsgroups comp.lang.python
Message-ID <mailman.628.1309875146.1164.python-list@python.org> (permalink)

Show all headers | View raw


On Jul 5, 2011, at 4:02 AM, Laszlo Nagy wrote:

>    def onPopupMenu(self,evt):
>        menu = wx.Menu()
>        for title,bitmap in self.getPopupMenuItems():
>            item = wx.MenuItem(None,-1,title)
>            if bitmap:
>                item.SetBitmap(bitmap)
>            menu.AppendItem(item)
>            menu.Bind(wx.EVT_MENU,self.onPopupMenuItemSelected,item)
>        self.PopupMenu( menu, evt.GetPoint())
>        menu.Destroy()
> 
> I have read somewhere that under GTK, I have to assign the bitmap before Append-ing the MenuItem to the Menu. So did I, but it doesn't work. Menu item icons are not showing up in Ubuntu. On Windows 7, everything is fine. What am I doing wrong?
> 
> System: Ubuntu 11 amd64
> Python: 2.7.1+
> wx.__version__ '2.8.11.0'

Hi Laszlo,
Two suggestions --

1. Post a complete example that demonstrates the problem so that we don't have to dummy up a wx app ourselves to try your code.

2. Ask on the wxPython mailing list.

Good luck
Philip

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: wx MenuItem - icon is missing Philip Semanchuk <philip@semanchuk.com> - 2011-07-05 08:50 -0400

csiph-web