X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1987af7e9f5685198b0c19e2326eebf7e56b7834..3cdb471c6a6027f336b793d141f7ba976c083e2c:/src/gtk/menu.cpp diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 5ebd301230..4cb9fe2243 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 */ @@ -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 -