]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/menu.cpp
*** empty log message ***
[wxWidgets.git] / src / gtk1 / menu.cpp
index 294636a191ecfd0f2db3d6e82d94e974cf9c2787..6b95c406e78b3d650ed000313c70cc37dbbc17f6 100644 (file)
@@ -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("<main>/");
     for ( const wxChar *pc = text; *pc != _T('\0'); pc++ )
     {
-        if (*pc == _T('_')) pc++; /* skip it */
+        while (*pc == _T('_')) pc++; /* skip it */
         s << *pc;
     }