Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.135 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.73; '*S*': 0.00; 'assign': 0.04; 'elif': 0.04; ':-)': 0.06; 'subject:missing': 0.07; 'traceback.': 0.16; 'wandering': 0.16; 'rewrite': 0.19; 'that?': 0.19; "aren't": 0.22; 'maybe': 0.22; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'code.': 0.22; 'platforms.': 0.23; 'worked': 0.24; 'code': 0.24; "i'm": 0.27; 'right,': 0.28; 'skip:i 30': 0.29; 'seem': 0.31; 'error': 0.31; 'generally': 0.33; "i'll": 0.33; "i've": 0.33; 'to:addr:python-list': 0.34; 'header:User-Agent:1': 0.34; 'couple': 0.34; "we're": 0.34; 'all.': 0.35; 'project': 0.35; 'icon': 0.35; 'probably': 0.35; 'install': 0.36; 'familiar': 0.36; 'some': 0.37; 'but': 0.37; 'received:192': 0.38; 'subject:: ': 0.38; 'created': 0.38; 'menu': 0.38; 'think': 0.38; 'platform': 0.38; 'common': 0.39; 'under': 0.39; 'to:addr:python.org': 0.39; 'might': 0.39; 'did': 0.40; 'where': 0.40; 'kind': 0.60; 'your': 0.60; "we've": 0.62; 'apps': 0.63; 'our': 0.63; 'ever': 0.65; 'here.': 0.66; 'received:62': 0.67; 'addressing': 0.67; 'common,': 0.84; 'received:192.168.0.100': 0.84; 'received:192.168.13': 0.84; 'received:62.179': 0.84; 'received:62.179.121': 0.84; 'received:62.179.121.47': 0.84; 'received:upcmail.net': 0.84; 'territory': 0.84 X-SourceIP: 89.132.76.204 Date: Wed, 06 Jul 2011 18:26:11 +0200 From: Laszlo Nagy User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; hu; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: wx MenuItem - icon is missing References: <4E12C505.3020300@shopzeus.com> <8B072395-5E0C-49C7-BBC4-38BAD25D0C05@semanchuk.com> <4E1366D5.6030208@shopzeus.com> <4E13FFE1.1080303@shopzeus.com> <7ED1FBA3-1A84-4A5C-A3E7-3286A03405F4@semanchuk.com> In-Reply-To: <7ED1FBA3-1A84-4A5C-A3E7-3286A03405F4@semanchuk.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=HQ3F56nxkum+cgCiDL7AXQpbvw7DWrWCBJRnYYnM0Zc= c=1 sm=0 a=557o2o7-KvIA:10 a=XQXf6iur_NIA:10 a=RSPf8KcgRHcA:10 a=8nJEP1OIZ-IA:10 a=_BZJYOTxsR6a2ZF2uiwA:9 a=wPNLvfGTeEIA:10 a=y6PkSiIaWnGSpzrJ:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310026861 news.xs4all.nl 21874 [2001:888:2000:d::a6]:47560 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9013 > 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. :-)