X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/232806507ba60bd768605f0d7e8ae8e27dc17e8b..6de9282600f340da051d0b3e195ffb8dff037760:/src/gtk1/menu.cpp diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 48ac17d030..10656f39f4 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -212,10 +212,13 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) /* local buffer in multibyte form */ wxString buf; - buf << '/' << str.mb_str(); + buf << _T('/') << str.c_str(); + char *cbuf = new char[buf.Length()]; + strcpy(cbuf, buf.mbc_str()); + GtkItemFactoryEntry entry; - entry.path = (gchar *)buf.c_str(); // const_cast + entry.path = (gchar *)cbuf; // const_cast entry.accelerator = (gchar*) NULL; entry.callback = (GtkItemFactoryCallback) NULL; entry.callback_action = 0; @@ -498,15 +501,6 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, id ); event.SetEventObject( menu ); -/* wxMSW doesn't call callback here either - - if (menu->m_callback) - { - (void) (*(menu->m_callback)) (*menu, event); - return; - } -*/ - if (menu->GetEventHandler()->ProcessEvent(event)) return; @@ -632,18 +626,13 @@ bool wxMenuItem::IsChecked() const IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler) -wxMenu::wxMenu( const wxString& title, const wxFunction func, long style ) -{ - Init(title, func, style); -} - -wxMenu::wxMenu(long style) -{ - Init(wxEmptyString, (wxFunction) NULL, style); -} - void -wxMenu::Init( const wxString& title, const wxFunction func, long style ) +wxMenu::Init( const wxString& title, + long style +#ifdef WXWIN_COMPATIBILITY + , const wxFunction func +#endif + ) { m_title = title; m_items.DeleteContents( TRUE ); @@ -658,7 +647,10 @@ wxMenu::Init( const wxString& title, const wxFunction func, long style ) m_menu = gtk_menu_new(); // Do not show! #endif +#ifdef WXWIN_COMPATIBILITY m_callback = func; +#endif + m_eventHandler = this; m_clientData = (void*) NULL;