Bitmap menu patch (GTK)

Hello,
as requested (on wxPython-users), here's the patch I submitted on SF a
while ago. Unfortunately, it fails to apply to wxGTK 2.4.1, but I think
it's only a matter of fixing line numbers (I can't check now,
sorry).

HTH,
Alberto

menu.cpp.patch (1.85 KB)

Alberto Griggio wrote:

Hello,
as requested (on wxPython-users), here's the patch I submitted on SF a
while ago. Unfortunately, it fails to apply to wxGTK 2.4.1, but I think
it's only a matter of fixing line numbers (I can't check now,
sorry).

Thanks!

···

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

Alberto Griggio wrote:

Hello,
as requested (on wxPython-users), here's the patch I submitted on SF a
while ago. Unfortunately, it fails to apply to wxGTK 2.4.1, but I think
it's only a matter of fixing line numbers (I can't check now,
sorry).

Hmm... It still doesn't generate an event when the item is clicked on. I've attached the cvs diff of how I adapted your patch. Did I miss something?

gtk-menu.cpp.patch (2.09 KB)

···

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

Hmm... It still doesn't generate an event when the item is clicked on.

  I've attached the cvs diff of how I adapted your patch. Did I miss
something?

No, the patch is right, it's the code that changed from 2.4.0 to 2.4.1

Line 1225 is now:

        gtk_signal_connect( GTK_OBJECT(menuItem), "activate_item",
                            GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
                            (gpointer)this );

but "activate_item" was "activate". Restoring the old value fixes the
problem. And this is (well, should be...) also right according to gtk+
docs:

"""
The "activate-item" signal

void user_function (GtkMenuItem *menuitem,
                                            gpointer user_data);

Emitted when the item is activated, but also if the menu item has a
submenu. For normal applications, the relevant signal is "activate".
"""

HTH,
Alberto

Alberto Griggio wrote:

Hmm... It still doesn't generate an event when the item is clicked on.

I've attached the cvs diff of how I adapted your patch. Did I miss something?

No, the patch is right, it's the code that changed from 2.4.0 to 2.4.1

Line 1225 is now:

        gtk_signal_connect( GTK_OBJECT(menuItem), "activate_item",
                            GTK_SIGNAL_FUNC(gtk_menu_clicked_callback), (gpointer)this );

but "activate_item" was "activate". Restoring the old value fixes the
problem. And this is (well, should be...) also right according to gtk+
docs:

Thanks, that was it. I'm checking in the fix now.

···

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