Picon
Favicon
Gravatar

First menu item has no image


I am creating a menu and assigning images to menu items, sometime
first item in menu doesn't display any image, I am not able to find
the reason. I have tried to make a simple stand alone example and
below is the code which does demonstrates the problem on my machine.
I am using windows XP, wx 2.8.7.1 (msw-unicode)'

    import wx

    def getBmp():
        bmp = wx.EmptyBitmap(16,16)
        return bmp

    class MyFrame(wx.Frame):
        def __init__(self):
            wx.Frame.__init__(self, style=wx.DEFAULT_FRAME_STYLE,
parent=None)

            self.SetTitle("why New has no image?")

            menuBar = wx.MenuBar()
            fileMenu=wx.Menu()
            item = fileMenu.Append(wx.ID_NEW, "New")
            item.SetBitmap(getBmp())
            item = fileMenu.Append(wx.ID_OPEN, "Open")
            item.SetBitmap(getBmp())
            item = fileMenu.Append(wx.ID_SAVE, "Save")
            item.SetBitmap(getBmp())
            menuBar.Append(fileMenu, "File")
            self.SetMenuBar(menuBar)

    app = wx.PySimpleApp()
    frame=MyFrame()
    frame.Show()
    app.SetTopWindow(frame)
    app.MainLoop()

So are you able to see the problem and what could be the reason for
it?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To post to this group, send email to wxPython-users <at> googlegroups.com
To unsubscribe from this group, send email to wxPython-users+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/wxPython-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane