]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/menu.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / gtk / menu.cpp
index 85587d91ffa347da3b38fa3a3b01e2e6736f6274..71dc66a136aaf990bd7c2dcf2112ba0927f48a33 100644 (file)
@@ -60,12 +60,12 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event)
     event.SetEventObject( menu );
 
     wxEvtHandler* handler = menu->GetEventHandler();
-    if (handler && handler->ProcessEvent(event))
+    if (handler && handler->SafelyProcessEvent(event))
         return;
 
     wxWindow *win = menu->GetInvokingWindow();
     if (win)
-        win->GetEventHandler()->ProcessEvent( event );
+        win->HandleWindowEvent( event );
 }
 
 extern "C" {
@@ -573,7 +573,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
         if (item->IsCheckable())
             commandEvent.SetInt(item->IsChecked());
 
-        frame->GetEventHandler()->ProcessEvent(commandEvent);
+        frame->HandleWindowEvent(commandEvent);
     }
     else
     {
@@ -601,11 +601,11 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
     event.SetEventObject( menu );
 
     wxEvtHandler* handler = menu->GetEventHandler();
-    if (handler && handler->ProcessEvent(event))
+    if (handler && handler->SafelyProcessEvent(event))
         return;
 
     wxWindow *win = menu->GetInvokingWindow();
-    if (win) win->GetEventHandler()->ProcessEvent( event );
+    if (win) win->HandleWindowEvent( event );
 }
 }
 
@@ -627,12 +627,12 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
     event.SetEventObject( menu );
 
     wxEvtHandler* handler = menu->GetEventHandler();
-    if (handler && handler->ProcessEvent(event))
+    if (handler && handler->SafelyProcessEvent(event))
         return;
 
     wxWindow *win = menu->GetInvokingWindow();
     if (win)
-        win->GetEventHandler()->ProcessEvent( event );
+        win->HandleWindowEvent( event );
 }
 }
 
@@ -1245,11 +1245,19 @@ wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item)
 wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
 {
     if ( !wxMenuBase::DoRemove(item) )
-        return (wxMenuItem *)NULL;
+        return NULL;
+
+    GtkWidget * const mitem = item->GetMenuItem();
+    if ( m_prevRadio == mitem )
+    {
+        // deleting an item starts a new radio group (has to as we shouldn't
+        // keep a deleted pointer anyhow)
+        m_prevRadio = NULL;
+    }
 
     // TODO: this code doesn't delete the item factory item and this seems
     //       impossible as of GTK 1.2.6.
-    gtk_widget_destroy( item->GetMenuItem() );
+    gtk_widget_destroy( mitem );
 
     return item;
 }