X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/455fadaa6a92b5fe9778ec4360855c833d4fcbe5..45fcbf3b7a7c9cfd96e67278e4eaa12e8e015651:/src/gtk1/menu.cpp diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 294636a191..6b95c406e7 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -216,12 +216,14 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) } else { +#if __WXGTK12__ if ( *pc == _T('_') ) { // underscores must be doubled to prevent them from being // interpreted as accelerator character prefix by GTK str << *pc; } +#endif // GTK+ 1.2 str << *pc; } @@ -594,8 +596,12 @@ void wxMenuItem::SetName( const wxString& str ) { #if (GTK_MINOR_VERSION > 0) m_text << _T('_'); - } else - if (*pc == _T('/')) /* we have to filter out slashes ... */ + } + else if ( *pc == _T('_') ) // escape underscores + { + m_text << _T("__"); + } + else if (*pc == _T('/')) /* we have to filter out slashes ... */ { m_text << _T('\\'); /* ... and replace them with back slashes */ #endif @@ -829,7 +835,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool wxString s = _T("
/"); for ( const wxChar *pc = text; *pc != _T('\0'); pc++ ) { - if (*pc == _T('_')) pc++; /* skip it */ + while (*pc == _T('_')) pc++; /* skip it */ s << *pc; }