simpler version of previous question about icons in menus

classic Classic list List threaded Threaded
11 messages Options
C M
Reply | Threaded
Open this post in threaded view
|

simpler version of previous question about icons in menus

C M
(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??

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

Tim Roberts
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/

--
Tim Roberts, [hidden email]
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
C M
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

C M


On Fri, Dec 5, 2014 at 1:31 PM, Tim Roberts <[hidden email]> wrote:
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






--
Tim Roberts, [hidden email]
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

werner-3
In reply to this post by C M
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

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

nepix32
In reply to this post by C M
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.


--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
C M
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

C M


On Sat, Dec 6, 2014 at 5:37 PM, nepix32 <[hidden email]> 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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

Igor Korot
Hi,

On Sat, Dec 6, 2014 at 10:02 PM, C M <[hidden email]> wrote:


On Sat, Dec 6, 2014 at 5:37 PM, nepix32 <[hidden email]> 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???

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.
 

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 [hidden email].
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
C M
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

C M


On Sat, Dec 6, 2014 at 10:10 PM, Igor Korot <[hidden email]> wrote:
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






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 [hidden email].
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 [hidden email].
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

Florian Höch
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.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

Nathan McCorkle


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).

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

wx_menu_demo.png (18K) Download Attachment
C M
Reply | Threaded
Open this post in threaded view
|

Re: simpler version of previous question about icons in menus

C M


On Mon, Dec 8, 2014 at 12:06 PM, Nathan McCorkle <[hidden email]> 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).

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

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.