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" {
if (item->IsCheckable())
commandEvent.SetInt(item->IsChecked());
- frame->GetEventHandler()->ProcessEvent(commandEvent);
+ frame->HandleWindowEvent(commandEvent);
}
else
{
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 );
}
}
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 );
}
}
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;
}