void wxMenuBase::UpdateUI(wxEvtHandler* source)
{
wxWindow * const win = GetWindow();
- if ( win )
- {
- // Don't update menus if the parent
- // frame is about to get deleted
- wxWindow *tlw = wxGetTopLevelParent(win);
- if (tlw && wxPendingDelete.Member(tlw))
- return;
- }
if ( !source && win )
source = win->GetEventHandler();
{
wxWindowID itemid = item->GetId();
wxUpdateUIEvent event(itemid);
- event.SetEventObject( source );
+ event.SetEventObject( this );
if ( source->ProcessEvent(event) )
{
void wxMenuBarBase::UpdateMenus()
{
- wxEvtHandler* source;
wxMenu* menu;
int nCount = GetMenuCount();
for (int n = 0; n < nCount; n++)
{
menu = GetMenu( n );
if (menu != NULL)
- {
- source = menu->GetEventHandler();
- if (source != NULL)
- menu->UpdateUI( source );
- }
+ menu->UpdateUI( NULL );
}
}