X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1987af7e9f5685198b0c19e2326eebf7e56b7834..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/gtk/menu.cpp diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 5ebd301230..750593b533 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -121,7 +121,7 @@ static void wxMenubarUnsetInvokingWindow( wxMenu *menu, wxWindow *win ) #if (GTK_MINOR_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native hot keys */ @@ -144,7 +144,7 @@ static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win ) #if (GTK_MINOR_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native hot keys */ @@ -166,7 +166,7 @@ void wxMenuBar::SetInvokingWindow( wxWindow *win ) m_invokingWindow = win; #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native key accelerators indicated by underscroes */ @@ -187,7 +187,7 @@ void wxMenuBar::UnsetInvokingWindow( wxWindow *win ) m_invokingWindow = (wxWindow*) NULL; #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) wxWindow *top_frame = win; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); /* support for native key accelerators indicated by underscroes */ @@ -469,13 +469,13 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) event.SetEventObject( menu ); event.SetInt(id ); -#if WXWIN_COMPATIBILITY +#if wxUSE_MENU_CALLBACK if (menu->GetCallback()) { (void) (*(menu->GetCallback())) (*menu, event); return; } -#endif // WXWIN_COMPATIBILITY +#endif // wxUSE_MENU_CALLBACK if (menu->GetEventHandler()->ProcessEvent(event)) return; @@ -757,11 +757,11 @@ void wxMenu::Init() wxMenu::~wxMenu() { + m_items.Clear(); + gtk_widget_destroy( m_menu ); gtk_object_unref( GTK_OBJECT(m_factory) ); - - // the menu items are deleted by the base class dtor } bool wxMenu::DoAppend(wxMenuItem *mitem) @@ -802,6 +802,7 @@ bool wxMenu::DoAppend(wxMenuItem *mitem) entry.callback = (GtkItemFactoryCallback) 0; entry.callback_action = 0; entry.item_type = ""; + entry.accelerator = (gchar*) NULL; gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */ @@ -832,6 +833,7 @@ bool wxMenu::DoAppend(wxMenuItem *mitem) entry.item_type = ""; else entry.item_type = ""; + entry.accelerator = (gchar*) NULL; #if wxUSE_ACCEL // due to an apparent bug in GTK+, we have to use a static buffer here -