X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e338053c007fb03faad1cb30089aa1f13dbf8ca0..8ca1a013e4e699724040ff1f514dab3b4a11d3c9:/src/gtk/tglbtn.cpp diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index 1e7e2acfc5..734b351d26 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -28,9 +28,6 @@ extern bool g_blockEventsOnDrag; extern "C" { static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxToggleButton *cb) { - if (g_isIdle) - wxapp_install_idle_handler(); - if (!cb->m_hasVMT || g_blockEventsOnDrag) return; @@ -58,9 +55,6 @@ bool wxToggleBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString &name) { - m_needParent = true; - m_acceptsFocus = true; - m_blockEvent = false; if (!PreCreation(parent, pos, size) || @@ -201,9 +195,6 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString &name) { - m_needParent = true; - m_acceptsFocus = true; - m_blockEvent = false; if (!PreCreation(parent, pos, size) || @@ -213,10 +204,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 +251,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*/)