]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/tglbtn.cpp
Forgot to remove wxBackingFile from the changes.txt. It was kept internal
[wxWidgets.git] / src / gtk / tglbtn.cpp
index 1e7e2acfc56d9ea9a8d5bdae9b421c98f8b55ec3..c90a09ec6d88f1a3681aeed148b5826143af68a7 100644 (file)
@@ -213,10 +213,10 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
         return false;
     }
 
-    wxControl::SetLabel(label);
-
     // Create the gtk widget.
-    m_widget = gtk_toggle_button_new_with_label( wxGTK_CONV( m_label ) );
+    m_widget = gtk_toggle_button_new_with_mnemonic("");
+
+    SetLabel(label);
 
     g_signal_connect (m_widget, "clicked",
                       G_CALLBACK (gtk_togglebutton_clicked_callback),
@@ -260,7 +260,11 @@ void wxToggleButton::SetLabel(const wxString& label)
 
     wxControl::SetLabel(label);
 
-    gtk_label_set_text(GTK_LABEL(GTK_BIN(m_widget)->child), wxGTK_CONV(GetLabel()));
+    const wxString labelGTK = GTKConvertMnemonics(label);
+
+    gtk_button_set_label(GTK_BUTTON(m_widget), wxGTK_CONV(labelGTK));
+
+    ApplyWidgetStyle( false );
 }
 
 bool wxToggleButton::Enable(bool enable /*=true*/)