Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'assign': 0.04; 'elif': 0.04; 'ubuntu': 0.04; 'subject:missing': 0.07; 'wxpython': 0.07; ':-(': 0.09; 'calculator': 0.09; 'exception.': 0.09; 'c++': 0.12; 'am,': 0.13; 'wrote:': 0.15; '46,': 0.16; '9.04': 0.16; '__init__': 0.16; 'assertion': 0.16; 'bye': 0.16; 'helped.': 0.16; 'independent,': 0.16; 'received:mindspring.com': 0.16; 'skip:" 100': 0.16; 'skip:/ 50': 0.16; 'traceback.': 0.16; 'virtualbox': 0.16; 'wandering': 0.16; 'x-mailer:apple mail (2.1084)': 0.16; '>>>': 0.16; 'rewrite': 0.19; 'that?': 0.19; '(most': 0.21; "aren't": 0.22; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'code.': 0.22; 'trying': 0.23; 'item.': 0.23; 'platforms.': 0.23; 'though.': 0.23; 'welcome.': 0.23; 'systems.': 0.23; 'worked': 0.24; 'code': 0.24; 'traceback': 0.25; 'guess': 0.28; 'seem': 0.31; 'error': 0.31; 'generally': 0.33; "i'll": 0.33; 'list.': 0.33; "i've": 0.33; 'to:addr:python-list': 0.34; 'received:24': 0.34; 'there': 0.34; 'couple': 0.34; 'test': 0.34; "we're": 0.34; 'all.': 0.35; 'project': 0.35; 'icon': 0.35; 'last):': 0.35; 'thank': 0.35; 'probably': 0.35; 'supposed': 0.35; 'charset:us- ascii': 0.36; 'file': 0.36; 'some': 0.37; 'but': 0.37; 'subject:: ': 0.38; 'menu': 0.38; 'something': 0.38; 'think': 0.38; 'platform': 0.38; 'mailing': 0.38; 'should': 0.39; 'header:Mime- Version:1': 0.39; 'got': 0.39; 'under': 0.39; 'to:addr:python.org': 0.39; 'might': 0.39; 'called': 0.40; 'where': 0.40; 'kind': 0.60; 'your': 0.60; 'header:Message-Id:1': 0.61; 'results': 0.62; 'you.': 0.62; "we've": 0.62; 'apps': 0.63; 'our': 0.63; 'ever': 0.65; 'addressing': 0.67; 'click': 0.79; '10.6': 0.84; 'common,': 0.84; 'popup': 0.84; 'received:69.73': 0.84; 'territory': 0.84; 'seriously,': 0.91; 'something.': 0.91 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: wx MenuItem - icon is missing From: Philip Semanchuk In-Reply-To: <4E13FFE1.1080303@shopzeus.com> Date: Wed, 6 Jul 2011 11:36:00 -0400 Content-Transfer-Encoding: quoted-printable References: <4E12C505.3020300@shopzeus.com> <8B072395-5E0C-49C7-BBC4-38BAD25D0C05@semanchuk.com> <4E1366D5.6030208@shopzeus.com> <4E13FFE1.1080303@shopzeus.com> To: Lista-Comp-Lang-Python list X-Mailer: Apple Mail (2.1084) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - deimos.nocdirect.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - semanchuk.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 64 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1309966578 news.xs4all.nl 21783 [2001:888:2000:d::a6]:59160 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8946 On Jul 6, 2011, at 2:25 AM, Laszlo Nagy wrote: >=20 >>> Under windows, this displays the icon for the popup menu item. Under = GTK it doesn't and there is no error message, no exception. >>=20 >> I get different results than you. >>=20 >> Under Ubuntu 9.04 w with wx 2.8.9.1, when I right click I see a menu = item called test with little icon of a calculator or something. >>=20 >> Under OS X 10.6 with wx 2.8.12.0 and Win XP with wx 2.8.10.1, when I = right click I get this -- >>=20 >> Traceback (most recent call last): >> File "x.py", line 46, in onPopupMenu >> item =3D wx.MenuItem(None,-1,u"Test") >> File = "/usr/local/lib/wxPython-unicode-2.8.12.0/lib/python2.6/site-packages/wx-2= .8-mac-unicode/wx/_core.py", line 11481, in __init__ >> _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, = **kwargs)) >> wx._core.PyAssertionError: C++ assertion "parentMenu !=3D NULL" = failed at /BUILD/wxPython-src-2.8.12.0/src/common/menucmn.cpp(389) in = wxMenuItemBase(): menuitem should have a menu > I guess I'll have to write to the wxPython mailing list. Seriously, = adding a simple menu to something is supposed to be platform = independent, but we got four different results on four systems. :-( 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. 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. 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 =3D=3D "__WXGTK__": do X elif wx.Platform =3D=3D "__WXMAC__": do Y etc. > Thank you for trying out though. You're welcome. VirtualBox helped. bye Philip