Implemented wxEventLoop for wxMotif, and used it in wxDialog::ShowModal,

wxWindow::DoPopupMenu and for the application main loop.
  Implemented wxWakeUpIdle.
  Fixed crash when a popup menu entry is used to close/destroy the parent
window of the menu.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19078 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-02-02 15:48:50 +00:00
parent d894c20113
commit 7e1bcfa80e
12 changed files with 575 additions and 346 deletions

View File

@@ -354,6 +354,7 @@ void wxMenuItemCallback (Widget WXUNUSED(w), XtPointer clientData,
item->GetMenuBar()->GetMenuBarFrame()->GetEventHandler()->ProcessEvent(commandEvent);
}
// this is the child of a popup menu
else if (item->GetTopMenu())
{
wxCommandEvent event (wxEVT_COMMAND_MENU_SELECTED, item->GetId());
@@ -361,6 +362,14 @@ void wxMenuItemCallback (Widget WXUNUSED(w), XtPointer clientData,
event.SetInt( item->GetId() );
item->GetTopMenu()->ProcessCommand (event);
// Since PopupMenu under Motif stills grab right mouse
// button events after it was closed, we need to delete
// the associated widgets to allow next PopUpMenu to
// appear; this needs to be done there because doing it in
// a WorkProc as before may cause crashes if a menu item causes
// the parent window of the menu to be destroyed
item->GetTopMenu()->DestroyWidgetAndDetach();
}
}
}