simpler version of previous question about icons in menus

(I asked a perhaps too involved version of this question…so here is a much to-the-point version)

How do you add a menu item with an icon to a wxMenu??

C M wrote:

(I asked a perhaps too involved version of this question..so here is a
much to-the-point version)

How do you add a menu item *with an icon* to a wxMenu??

After you create the wx.MenuItem, you call SetBitmap.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

C M wrote:
> (I asked a perhaps too involved version of this question..so here is a
> much to-the-point version)
>
> How do you add a menu item *with an icon* to a wxMenu??

After you create the wx.MenuItem, you call SetBitmap.

http://zetcode.com/wxpython/menustoolbars/

Thanks, Tim, but then what? Use AddItem()? Because if I do that, the effect
is wrong. Here is what the icons should look like (using Firefox as an
example):

​And yet here is what a wxPython menu looks like using the three steps of
1) creating the menuItem, 2) calling SetBitmap on it, and 3) using
AddItem() to add it to the menu:


(the whited out part is just me removing extraneous info). The point is,
the icon is too close to the words, and the subtle vertical separator line
is gone. This isn't right/native, I don't think.

Could this be a wxWidgets/wxPython bug?

Thanks,
Che

menu3.png

···

On Fri, Dec 5, 2014 at 1:31 PM, Tim Roberts <timr@probo.com> wrote:

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Che,

···

On 12/5/2014 19:02, C M wrote:

(I asked a perhaps too involved version of this question..so here is a much to-the-point version)

How do you add a menu item *with an icon* to a wxMenu??

I don't see anything wrong with what you do with the MenuItem. Maybe something with the MenuBar or Menu?

What about a small runnable sample which shows the problem?

Have a nice weekend.
Werner

I looked at the wxPython Demo 2.9.5 (the Menu example):

On WinXP the menu looked like in your lower example (icon closer to text, no vertical bar)

On Win8.1 the menu looked like in your Firefox example (icon further away, vertical bar between icon and menu text)

So it may depend on the platform and the desktop theme.

···

On Saturday, December 6, 2014 3:12:26 AM UTC+1, Che M wrote:

The point is, the icon is too close to the words, and the subtle vertical separator line is gone. This isn’t right/native, I don’t think.

The point is, the icon is too close to the words, and the subtle
vertical separator line is gone. This isn't right/native, I don't think.

I looked at the wxPython Demo 2.9.5 (the Menu example):
On WinXP the menu looked like in your lower example (icon closer to text,
no vertical bar)
On Win8.1 the menu looked like in your Firefox example (icon further away,
vertical bar between icon and menu text)

So it may depend on the platform and the desktop theme.

That is a very good point, and I did not think to check the Demo. I just
checked and on Windows 7, the it looks like "icon closer to text, no
vertical bar" style. This can be seen in the menu under "Fun", with the
"Smile" menu item with the smiley face.

But the point is, this seems "wrong". I suggest that because it seems to me
inconsistent. If there are no icons in the menu, there is the vertical line
providing a column perfectly sized for small icons. But if there is even a
single icon in the whole menu, the whole layout reverts to a style without
this column for icons. But the column is clearly there for icons to be
(potentially) placed. That is why I showed the Firefox screenshot, where
they do just that:

​So I'm thinking this is maybe an issue with how wxWidgets does the
menus...but if wx is supposed to be the *native* widget......well, then I
am confused. Could the inconsistency be at the level of the Windows 7
native widgets...but not the Windows 8 ones???

Che

···

On Sat, Dec 6, 2014 at 5:37 PM, nepix32 <nepix32@gmail.com> wrote:

On Saturday, December 6, 2014 3:12:26 AM UTC+1, Che M wrote:

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

···

On Sat, Dec 6, 2014 at 10:02 PM, C M cmpython@gmail.com wrote:

More likely Firefox does something on its own here. And it can’t be considered a native application.

What about IE? WordPad? Word/Excel?

Thank you.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

On Sat, Dec 6, 2014 at 5:37 PM, nepix32 nepix32@gmail.com wrote:

On Saturday, December 6, 2014 3:12:26 AM UTC+1, Che M wrote:

The point is, the icon is too close to the words, and the subtle vertical separator line is gone. This isn’t right/native, I don’t think.

I looked at the wxPython Demo 2.9.5 (the Menu example):

On WinXP the menu looked like in your lower example (icon closer to text, no vertical bar)

On Win8.1 the menu looked like in your Firefox example (icon further away, vertical bar between icon and menu text)

So it may depend on the platform and the desktop theme.

That is a very good point, and I did not think to check the Demo. I just checked and on Windows 7, the it looks like “icon closer to text, no vertical bar” style. This can be seen in the menu under “Fun”, with the “Smile” menu item with the smiley face.

But the point is, this seems “wrong”. I suggest that because it seems to me inconsistent. If there are no icons in the menu, there is the vertical line providing a column perfectly sized for small icons. But if there is even a single icon in the whole menu, the whole layout reverts to a style without this column for icons. But the column is clearly there for icons to be (potentially) placed. That is why I showed the Firefox screenshot, where they do just that:

​So I’m thinking this is maybe an issue with how wxWidgets does the menus…but if wx is supposed to be the native widget…well, then I am confused. Could the inconsistency be at the level of the Windows 7 native widgets…but not the Windows 8 ones???

Che

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi,

More likely Firefox does something on its own here. And it can't be
considered a native application.
What about IE? WordPad? Word/Excel?

WordPad and all Office applications use the Ribbon bar.

But I think with IE we have a winner! See here:

​You can see the folders icons and that other yellow bitmap, by Suggested
Sites. This is with IE 11 (version 11.0.14), so that seems up to date.

So I am positing that the wx way of doing this is "off'. I could easily be
overlooking something, though. I hope I'm wrong (it's not a huge deal, but
I think it looks worse/non-native).

Che

···

On Sat, Dec 6, 2014 at 10:10 PM, Igor Korot <ikorot01@gmail.com> wrote:

Thank you.

Che

--
You received this message because you are subscribed to the Google
Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

for me the wxPython (3.0.1.1) menu demo looks right, i.e. unlike your
screenshot, I have the vertical line bewtween icon and text (Using Aero
/ Windows 7 x64). Which wxPython version are you using?

Florian.

Looks right here, using wxPython 3.0.0-msw (classic) on Win 7 with some of the graphics stuff turned on (I am not sure if the start menu with a non-windows-95 Start button means ‘Aero’ is on or not), with Python 2.7.5.1

It looks strange on WinXP, as you mention, without the vertical line. That was on WinXP with wxpython-3.0.1-msw (classic).

···

On Sunday, December 7, 2014 4:18:22 AM UTC-8, Florian Höch wrote:

Hi,

for me the wxPython (3.0.1.1) menu demo looks right, i.e. unlike your

screenshot, I have the vertical line bewtween icon and text (Using Aero

/ Windows 7 x64). Which wxPython version are you using?

Great. Looks like the problem for me was just using an older version of wx.
Thanks everyone.

···

On Mon, Dec 8, 2014 at 12:06 PM, Nathan McCorkle <nmz787@gmail.com> wrote:

On Sunday, December 7, 2014 4:18:22 AM UTC-8, Florian Höch wrote:

Hi,

for me the wxPython (3.0.1.1) menu demo looks right, i.e. unlike your
screenshot, I have the vertical line bewtween icon and text (Using Aero
/ Windows 7 x64). Which wxPython version are you using?

Looks right here, using wxPython 3.0.0-msw (classic) on Win 7 with some of
the graphics stuff turned on (I am not sure if the start menu with a
non-windows-95 Start button means 'Aero' is on or not), with Python 2.7.5.1

It looks strange on WinXP, as you mention, without the vertical line. That
was on WinXP with wxpython-3.0.1-msw (classic).