diff --git a/Gtkmm3/gtk141_minesweeper2/src/InputBox.cc b/Gtkmm3/gtk141_minesweeper2/src/InputBox.cc index 12dfe41..d32b6b0 100644 --- a/Gtkmm3/gtk141_minesweeper2/src/InputBox.cc +++ b/Gtkmm3/gtk141_minesweeper2/src/InputBox.cc @@ -7,6 +7,7 @@ InputBox::InputBox(BaseObjectType *cobject, const Glib::RefPtr &re { // Get Widgets ref_builder->get_widget("entry_name", entry_name); + entry_name->signal_activate().connect(sigc::mem_fun(*this, &InputBox::entry_activated)); } void InputBox::on_response(int response_id){ @@ -57,6 +58,11 @@ void InputBox::set_game_time(int time){ game_time = time; } +void InputBox::entry_activated(){ + // Default response + response(Gtk::RESPONSE_OK); +} + InputBox *InputBox::create(Gtk::Window &parent) { // Create a inputbox object diff --git a/Gtkmm3/gtk141_minesweeper2/src/InputBox.hh b/Gtkmm3/gtk141_minesweeper2/src/InputBox.hh index dc4478b..fd5cbbf 100644 --- a/Gtkmm3/gtk141_minesweeper2/src/InputBox.hh +++ b/Gtkmm3/gtk141_minesweeper2/src/InputBox.hh @@ -28,4 +28,7 @@ class InputBox : public Gtk::Dialog{ // Child widget Gtk::Entry *entry_name; + + // Signal Handlers + void entry_activated(); }; \ No newline at end of file