473,394 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

MenuItem icon doesn't display

Windows XP Media Center - Python 2.5 - wxPython 2.8
Code ...
Expand|Select|Wrap|Line Numbers
  1. bmp = wx.Image("images\\new24.bmp", wx.BITMAP_TYPE_BMP).ConvertToBitmap()
  2.         print str(bmp.GetWidth())
  3.         self.fileNewItem = fileMenu.Append(-1, "New ...", "Create new image")
  4.         self.fileNewItem.SetBitmap(bmp)
  5.         bmp = self.fileNewItem.GetBitmap()
  6.         print str(bmp.GetWidth())
  7.         self.Bind(wx.EVT_MENU, self.OnFileNew, self.fileNewItem)
  8.  
... output> 24 24
This is a 'New' menu item under a 'File' menu. The bitmap doesn't display, even though the print statements I've inserted show that the bmp is being loaded and set. There are several menu items with icons after this one, which is the first, and they all display.
Apr 5 '07 #1
2 1907
bartonc
6,596 Expert 4TB
Windows XP Media Center - Python 2.5 - wxPython 2.8
Code ...
Expand|Select|Wrap|Line Numbers
  1. bmp = wx.Image("images\\new24.bmp", wx.BITMAP_TYPE_BMP).ConvertToBitmap()
  2.         print str(bmp.GetWidth())
  3.         self.fileNewItem = fileMenu.Append(-1, "New ...", "Create new image")
  4.         self.fileNewItem.SetBitmap(bmp)
  5.         bmp = self.fileNewItem.GetBitmap()
  6.         print str(bmp.GetWidth())
  7.         self.Bind(wx.EVT_MENU, self.OnFileNew, self.fileNewItem)
  8.  
... output> 24 24
This is a 'New' menu item under a 'File' menu. The bitmap doesn't display, even though the print statements I've inserted show that the bmp is being loaded and set. There are several menu items with icons after this one, which is the first, and they all display.
Hi, Jimmy. You'll notice that I've added the CODE tags in order to make the structure of you code come through. You can read about them in "REPLY GUIDELINES" on the right hand side of the page (while you are replying).

I'm sorry that I don't have experience with bitmaps in menu items. This is most puzzling, due to the fact that some work.

Thanks for joining TheScripts.com. There are many other wxPython issues that I can help with.
Apr 6 '07 #2
Thanks, I'll undoubtely be back.
I left it for the time being...
The next menu 'View', has no bitmaps. Then the 'Edit' menu, and ... same thing. The first menuitem 'Undo' has a bitmap which doesn't display, although subsequent items on the same menu do. So it seems to be something about that first menuitem.
Apr 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tim Jarman | last post by:
Apologies in advance for the long post - I wanted to be sure I included all the relevant details. The answer is probably very, very simple. I am doing something stupid here, but I don't know what...
3
by: Sam | last post by:
I've been googling for a couple of hours now and tried some different things, but I've been unable to get the icon for a distributed access application to do anything but display the default...
1
by: todorov-fkt | last post by:
Hello, I would like to create a menu which items have both icon and text (if anyone wonders what I'm talking about, please look @ Favorites menu in Explorer - folders have a folder icon in front...
6
by: Claus Holm | last post by:
I'm trying to enable a menuitem in the parent form from a mdichild. Rather than making the menuitems public, I'd go for a public method in the parent form to do the change, but when I call the...
6
by: Eric Sabine | last post by:
Basically, the following code creates a menuItem array and tries to use it twice. In the following piece of code, only the line that appears second gets used. The first becomes ignored presumably...
1
by: Eric Sabine | last post by:
I have a function that returns a menuitem() array. This array is used elsewhere within the application, but most importantly in the system tran in a notify icon. All works great except that for...
0
by: ZH | last post by:
Hi There, I have an application that runs from the systray. When the user right clicks on the icon it shows the user a list of of menu items. That works without a problem. The problem is...
4
by: Jeff Mason | last post by:
I have an application where I need to set certain menu items invisible based on a user privilege. We did a sinmlar thing in VB6 and used the menu item's tag property to assign an identifier to...
1
by: Dave | last post by:
Can you select which MenuItem to display through code? Thanks <asp:Menu id="Menu1" Orientation="Horizontal" StaticMenuItemStyle-CssClass="tab" StaticSelectedStyle-CssClass="selectedTab"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.