- //Format mnemonics properly for GTK2. This can be called from GTK1.x, but
- //it's not very useful because mnemonics don't exist prior to GTK2.
- wxString label2;
- for (size_t i = 0; i < label.Len(); i++)
+ // don't call the virtual function which might call this one back again
+ wxControl::SetLabel(label);
+
+ const wxString labelGTK = GTKRemoveMnemonics(label);
+
+ gtk_label_set(w, wxGTK_CONV(labelGTK));
+}
+
+void wxControl::GTKSetLabelForFrame(GtkFrame *w, const wxString& label)
+{
+ wxControl::SetLabel(label);
+
+ const wxString labelGTK = GTKRemoveMnemonics(label);
+
+ gtk_frame_set_label(w, labelGTK.empty() ? (char *)NULL
+ : wxGTK_CONV(labelGTK));
+}
+
+/* static */
+wxString wxControl::GTKRemoveMnemonics(const wxString& label)
+{
+ const size_t len = label.length();
+ wxString labelGTK;
+ labelGTK.reserve(len);
+ for ( size_t i = 0; i < len; i++ )