Implement mnemnic support for wxToggleButton.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2006-10-15 20:12:41 +00:00
parent e47c778924
commit ecf3b4a57f

View 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*/)