]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/menu.cpp
add PostSizeEvent() and use it in wxMSW status bar code (#9795)
[wxWidgets.git] / src / gtk / menu.cpp
index 634dae20a1b2ad570b39bc659b606ac0050e08ba..47ece481a3592c403b6a34f586d21a5d0249a4c6 100644 (file)
@@ -488,34 +488,8 @@ static void menuitem_activate(GtkWidget*, wxMenuItem* item)
         }
     }
 
-
-    // Is this menu on a menubar?  (possibly nested)
     wxMenu* menu = item->GetMenu();
-    wxFrame* frame = NULL;
-    if(menu->IsAttached())
-        frame = menu->GetMenuBar()->GetFrame();
-
-    // FIXME: why do we have to call wxFrame::GetEventHandler() directly here?
-    //        normally wxMenu::SendEvent() should be enough, if it doesn't work
-    //        in wxGTK then we have a bug in wxMenu::GetInvokingWindow() which
-    //        should be fixed instead of working around it here...
-    if (frame)
-    {
-        // If it is attached then let the frame send the event.
-        // Don't call frame->ProcessCommand(id) because it toggles
-        // checkable items and we've already done that above.
-        wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
-        commandEvent.SetEventObject(frame);
-        if (item->IsCheckable())
-            commandEvent.SetInt(item->IsChecked());
-
-        frame->HandleWindowEvent(commandEvent);
-    }
-    else
-    {
-        // otherwise let the menu have it
-        menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1);
-    }
+    menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1);
 }
 }
 
@@ -813,16 +787,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
             const char* stockid;
             if (bitmap.IsOk())
             {
-                GtkWidget* image;
-                if (bitmap.HasPixbuf())
-                    image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf());
-                else
-                {
-                    GdkPixmap* mask = NULL;
-                    if (bitmap.GetMask())
-                        mask = bitmap.GetMask()->GetBitmap();
-                    image = gtk_image_new_from_pixmap(bitmap.GetPixmap(), mask);
-                }
+                // always use pixbuf, because pixmap mask does not
+                // work with disabled images in some themes
+                GtkWidget* image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf());
                 menuItem = gtk_image_menu_item_new_with_label("");
                 gtk_widget_show(image);
                 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuItem), image);