]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/menu.cpp
added wxDIB::Save() and wxDIB to/from wxBitmap) conversions, use them instead of...
[wxWidgets.git] / src / gtk1 / menu.cpp
index 34cec7b6571ea893aed772ee75c8b4ff4fa8ce63..941df0c8339b52ec27d6162cc1c5918c94edd818 100644 (file)
@@ -161,6 +161,24 @@ static wxString wxReplaceUnderscore( const wxString& title )
     return str;
 }
 
+//-----------------------------------------------------------------------------
+// activate message from GTK
+//-----------------------------------------------------------------------------
+
+static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
+{
+    if (g_isIdle) wxapp_install_idle_handler();
+
+    wxMenuEvent event( wxEVT_MENU_OPEN, -1 );
+    event.SetEventObject( menu );
+
+    if (menu->GetEventHandler()->ProcessEvent(event))
+        return;
+
+    wxWindow *win = menu->GetInvokingWindow();
+    if (win) win->GetEventHandler()->ProcessEvent( event );
+}
+
 //-----------------------------------------------------------------------------
 // wxMenuBar
 //-----------------------------------------------------------------------------
@@ -392,6 +410,10 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
 
 #endif
 
+    gtk_signal_connect( GTK_OBJECT(menu->m_owner), "activate",
+                        GTK_SIGNAL_FUNC(gtk_menu_open_callback),
+                        (gpointer)menu );
+
     // m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
     // addings menu later on.
     if (m_invokingWindow)