void MyFrame::OnButtonClicked(wxCommandEvent& event) { wxString str = event.GetString(); wxMessageBox(str, "Button Clicked"); }
void MyFrame::OnTextEntered(wxCommandEvent& event) { wxString str = event.GetString(); wxMessageBox("You entered: " + str, "Text Entered"); } void MyFrame::CreateMyTextControl() { wxTextCtrl* textCtrl = new wxTextCtrl(this, wxID_ANY, ""); Connect(textCtrl->GetId(), wxEVT_TEXT_ENTER, wxCommandEventHandler(MyFrame::OnTextEntered)); }These examples both use the wxWidgets library.