[wxPython] wxMenuItem.SetBitmap on GTK

Hello,
some days ago I read on this list that wxGTK doesn't support
icons on menu items, or at least this is what I understood. This seems
to be not true: the C++ version works, it's only wxPython that lacks
this support. After spending some time on the sources, I discovered that
the patch needed is (apparently) really trivial, so I decided to try it
and it seems to work: I've not tested it very much, but in the
wxListCtrl demo now the popup menu has an item with the smile icon.

If someone is interested, here are the patches to apply to wxPython
2.3.2.1 (patch -p0 <diff-file from the toplmost dir, i.e
wxPython-2.3.2.1)

Bye,
Alberto

windows.cpp.diff (3.9 KB)

windows.py.diff (706 Bytes)

some days ago I read on this list that wxGTK doesn't support
icons on menu items, or at least this is what I understood. This seems
to be not true: the C++ version works, it's only wxPython that lacks
this support.

Thanks! I must have missed the cvs checkin message when this was added.
Loks like it's been there for quite some time.

After spending some time on the sources, I discovered that
the patch needed is (apparently) really trivial,

Actually, it's even more trivial. Only two lines need added to windows.i,
SWIG takes care of the rest.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

This is all a bit over my head, but from the practical point of view, do I
need to wait to the next official wxPython release to get the icons on the
menu, or will the current files be updated for download.

Thanks

···

On Tuesday 13 August 2002 3:29 am, you wrote:

> some days ago I read on this list that wxGTK doesn't support
> icons on menu items, or at least this is what I understood. This seems
> to be not true: the C++ version works, it's only wxPython that lacks
> this support.

Thanks! I must have missed the cvs checkin message when this was added.
Loks like it's been there for quite some time.

> After spending some time on the sources, I discovered that
> the patch needed is (apparently) really trivial,

Actually, it's even more trivial. Only two lines need added to windows.i,
SWIG takes care of the rest.

This is all a bit over my head, but from the practical point of view, do I
need to wait to the next official wxPython release to get the icons on the
menu, or will the current files be updated for download.

If you don't feel comfortable building wxPython yourself, then yes you'll
need to wait for the release. Otherwise the changes are now in the CVS
source repository.

--Robin