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


Groups > comp.lang.python > #9013 > unrolled thread

Re: wx MenuItem - icon is missing

Started byLaszlo Nagy <gandalf@shopzeus.com>
First post2011-07-06 18:26 +0200
Last post2011-07-06 18:26 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: wx MenuItem - icon is missing Laszlo Nagy <gandalf@shopzeus.com> - 2011-07-06 18:26 +0200

#9013 — Re: wx MenuItem - icon is missing

FromLaszlo Nagy <gandalf@shopzeus.com>
Date2011-07-06 18:26 +0200
SubjectRe: wx MenuItem - icon is missing
Message-ID<mailman.733.1310026861.1164.python-list@python.org>
> I can understand why it's frustrating but a menu items with icons on them aren't exactly common, so you're wandering into territory that's probably not so throughly explored (nor standard across platforms). Now that I think about it, I don't know that I've ever seen one under OSX, and I don't even know if it's supported at all.
Maybe you are right, I'm not familiar with OS X. But they are common in 
GTK, Qt and Windows.
> Me, I would start by addressing the error in the traceback. wx doesn't seem happy with an orphan menu item; why not create a wx.Menu and assign the menu item to that? It might solve your icon problem; you never know.
I did create it:

         menu = wx.Menu() # wx.Menu created here.
         item = wx.MenuItem(None,-1,u"Test")
         item.SetBitmap(img.GetBitmap())
         menu.AppendItem(item) # Item added to menu here.

> In defense of wxPython, we have three wx apps in our project and they contain very little platform-specific code. To be fair, we've had to rewrite some code after we found that it worked on one platform but not another, but generally we're able to find code that works on all platforms. We have only a couple of places where we were forced to resort to this kind of thing:
>
>     if wx.Platform == "__WXGTK__":
>        do X
>     elif wx.Platform == "__WXMAC__":
>        do Y
>     etc.
Hmmm then probably I'll have to install other OS too. :-)

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web