menu with bitmap and wx.Item_Check

Hi Phil,

I have a menu that has about 10 items, and the currently selected one needs
to have check mark infront of it.
But they also want a bitmap with the item so that the user knows which one
to select.
From menuexample.py I can get a bitmap to display

       theme = wx.MenuItem(file, 2, 'Theme Black')
       theme.SetBitmap(wx.Bitmap('bw16.png'))

or a check mark to display

       theme = wx.MenuItem(file, 2, 'Theme Black', kind=wx.ITEM_CHECK)

but if I do both

       theme = wx.MenuItem(file, 1, 'Theme Black', kind=wx.ITEM_CHECK)
       theme.SetBitmap(wx.Bitmap('bw16.png'))

then what I get is a space for the bitmap, and when it is selected the
bitmap displays.
So only the currently selected items has a bitmap.

What am I doing wrong, the complete program is shown below.

I don't think you can do both, at least on Windows. But if you are not
going to use Mac (and assuming that wx.PopupWindow is still not
implemented on the Mac), you might try my FlatMenu in wxPython SVN:

http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/AGW/agw/flatmenu.py?revision=56478&view=markup

Or better install the latest wxPython pre-release (which contains all
the AGW goodies) here:

http://wxpython.wxcommunity.com/preview/20090128/

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Tue, Feb 3, 2009 at 2:16 AM, Phil Schloss wrote:

Thanks, but I need Mac, so it looks like they are going to have to be happy with
just names for the themes.

Phil

···

At 03:12 AM 2/3/2009, Andrea Gavana wrote:

Hi Phil,

On Tue, Feb 3, 2009 at 2:16 AM, Phil Schloss wrote:
> I have a menu that has about 10 items, and the currently selected one needs
> to have check mark infront of it.
> But they also want a bitmap with the item so that the user knows which one
> to select.
> From menuexample.py I can get a bitmap to display
>
> theme = wx.MenuItem(file, 2, 'Theme Black')
> theme.SetBitmap(wx.Bitmap('bw16.png'))
>
> or a check mark to display
>
> theme = wx.MenuItem(file, 2, 'Theme Black', kind=wx.ITEM_CHECK)
>
> but if I do both
>
> theme = wx.MenuItem(file, 1, 'Theme Black', kind=wx.ITEM_CHECK)
> theme.SetBitmap(wx.Bitmap('bw16.png'))
>
> then what I get is a space for the bitmap, and when it is selected the
> bitmap displays.
> So only the currently selected items has a bitmap.
>
> What am I doing wrong, the complete program is shown below.

I don't think you can do both, at least on Windows. But if you are not
going to use Mac (and assuming that wx.PopupWindow is still not
implemented on the Mac), you might try my FlatMenu in wxPython SVN:

http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/AGW/agw/flatmenu.py?revision=56478&view=markup

Or better install the latest wxPython pre-release (which contains all
the AGW goodies) here:

NameBright - Coming Soon

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users