On Windows 7, I notice that depending on how you put items into menus, there are two different visual effects. I suspect one is right and one is wrong, and I’d like to know what is best to do–not only for Windows, but for OSX and Linux.
This is an image of a menu (from Firefox) on Windows 7, showing the items as text with a unbroken subtle vertical line to the left of them, as if creating space to the left for a column of icons, if wanted:
Here then is a Firefox menu with items where some of them do have icons in that “column”:
Given that this is how Firefox is doing it, I assume this is the “correct” (MS and/or Mac HIG-wise) way. Is that assumption right?
Contrasting that, here is a wxPython application with menu items with and without icons, causing a different effect:
Notice with that one there is no vertical line. In this case, I used this code to add this first item, with the icon:
item = wx.MenuItem(my_menu, wxID_FRAME1MENU1ITEMS0, ‘Hi wxPython!’)
item.SetBitmap(self.notes_bmp)
my_menu.AppendItem(item)
And this code to add the second item without the icon:
my_menu.Append(help=’’, id=wxID_FRAME1MENU1ITEMS1, kind=wx.ITEM_NORMAL,
text=u’No icon here’)
Interestingly, if I only did this, I would have the vertical line and “column for icons”. But doing the first bit of code seems to put the menu in a different state where there is no such column for icons.
So I’m assuming menu.AppendItem() is NOT the right way to do it. I mean, it works, but it seems like it produces a GUI look that is not the convention now? And that menu.Append() is the right way. But how do you include icons with menu.Append()?
So, then, overall: what is the right way to get menu items with icons, and is it the same for Linux and OSX? (I hope this is clear).
Thanks,
Che