]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/menu.cpp
Applied patch [ 578052 ] Doc/View and recursion problems
[wxWidgets.git] / src / gtk1 / menu.cpp
index 277353786ddc9b5a07cc1fd45ff7f91a50a199a3..586b2ea0340f6e4a080e6d388fc40865de8f0b74 100644 (file)
@@ -775,6 +775,14 @@ wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
 
 void wxMenuItem::SetText( const wxString& str )
 {
+    // Some optimization to avoid flicker
+    wxString oldLabel = m_text;
+    oldLabel = wxStripMenuCodes(oldLabel.BeforeFirst('\t'));
+    oldLabel.Replace(wxT("_"), wxT(""));
+    wxString label1 = wxStripMenuCodes(str.BeforeFirst('\t'));
+    if (oldLabel == label1)
+        return;
+    
     DoSetText(str);
 
     if (m_menuItem)