From dcaa9cd70d04c8f6eb63c814068c9fa5a60adc7e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 16 May 2007 02:43:06 +0000 Subject: tim mayberry's patches to fix middle-click pasting ina couple of dialogs (merged from trunk) git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@1852 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/gtkmm2ext/gtkmm2ext/prompter.h | 3 ++- libs/gtkmm2ext/prompter.cc | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'libs') diff --git a/libs/gtkmm2ext/gtkmm2ext/prompter.h b/libs/gtkmm2ext/gtkmm2ext/prompter.h index 10870ee752..5f71463288 100644 --- a/libs/gtkmm2ext/gtkmm2ext/prompter.h +++ b/libs/gtkmm2ext/gtkmm2ext/prompter.h @@ -53,11 +53,12 @@ class Prompter : public Gtk::Dialog void change_labels (std::string ok, std::string cancel); void get_result (std::string &str, bool strip=true); - bool maybe_allow_response (GdkEventKey* ); protected: Gtk::Entry& the_entry() { return entry; } + void on_entry_changed (); + private: Gtk::Entry entry; Gtk::HBox entryBox; diff --git a/libs/gtkmm2ext/prompter.cc b/libs/gtkmm2ext/prompter.cc index d06204d356..0ff9710338 100644 --- a/libs/gtkmm2ext/prompter.cc +++ b/libs/gtkmm2ext/prompter.cc @@ -70,7 +70,7 @@ Prompter::init () get_vbox()->pack_start (entryBox); show_all_children(); - entry.signal_key_release_event().connect (mem_fun (*this, &Prompter::maybe_allow_response)); + entry.signal_changed().connect (mem_fun (*this, &Prompter::on_entry_changed)); entry.signal_activate().connect (bind (mem_fun (*this, &Prompter::response), Gtk::RESPONSE_ACCEPT)); } @@ -90,22 +90,20 @@ Prompter::get_result (string &str, bool strip) } } -bool -Prompter::maybe_allow_response (GdkEventKey* ev) +void +Prompter::on_entry_changed () { - /* + /* This is set up so that entering text in the entry field makes the RESPONSE_ACCEPT button active. Of course if you haven't added a RESPONSE_ACCEPT button, nothing will happen at all. */ - if (entry.get_text() != "") { + if (entry.get_text() != "") { set_response_sensitive (Gtk::RESPONSE_ACCEPT, true); set_default_response (Gtk::RESPONSE_ACCEPT); } else { set_response_sensitive (Gtk::RESPONSE_ACCEPT, false); } - return true; } - -- cgit v1.2.3