summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-07-10 20:01:47 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-07-10 20:01:47 +0000
commit26843b34fdd62e6f80630868c5eb3f8fee0c17f1 (patch)
treefe4001528aa6e4e360ec6392c7b1120ca75e0aa9 /libs/gtkmm2ext
parent05f8fcd189ca714c2c18b9fb174d5813140849df (diff)
modification to make generic MIDI actually work again
git-svn-id: svn://localhost/ardour2/trunk@673 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r--libs/gtkmm2ext/binding_proxy.cc12
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/binding_proxy.h3
-rw-r--r--libs/gtkmm2ext/popup.cc14
3 files changed, 21 insertions, 8 deletions
diff --git a/libs/gtkmm2ext/binding_proxy.cc b/libs/gtkmm2ext/binding_proxy.cc
index a29cb41632..3a2f5bbbc8 100644
--- a/libs/gtkmm2ext/binding_proxy.cc
+++ b/libs/gtkmm2ext/binding_proxy.cc
@@ -62,7 +62,8 @@ BindingProxy::button_press_handler (GdkEventButton *ev)
if (Controllable::StartLearning (&controllable)) {
string prompt = _("operate controller now");
prompter.set_text (prompt);
- prompter.show_all ();
+ prompter.touch (); // shows popup
+ learning_connection = controllable.LearningFinished.connect (mem_fun (*this, &BindingProxy::learning_finished));
}
return true;
}
@@ -70,9 +71,18 @@ BindingProxy::button_press_handler (GdkEventButton *ev)
return false;
}
+void
+BindingProxy::learning_finished ()
+{
+ learning_connection.disconnect ();
+ prompter.touch (); // hides popup
+}
+
+
bool
BindingProxy::prompter_hiding (GdkEventAny *ev)
{
+ learning_connection.disconnect ();
Controllable::StopLearning (&controllable);
return false;
}
diff --git a/libs/gtkmm2ext/gtkmm2ext/binding_proxy.h b/libs/gtkmm2ext/gtkmm2ext/binding_proxy.h
index 365668f72c..a26c8ace2a 100644
--- a/libs/gtkmm2ext/gtkmm2ext/binding_proxy.h
+++ b/libs/gtkmm2ext/gtkmm2ext/binding_proxy.h
@@ -46,7 +46,8 @@ class BindingProxy : public sigc::trackable
PBD::Controllable& controllable;
guint bind_button;
guint bind_statemask;
-
+ sigc::connection learning_connection;
+ void learning_finished ();
bool prompter_hiding (GdkEventAny *);
};
diff --git a/libs/gtkmm2ext/popup.cc b/libs/gtkmm2ext/popup.cc
index 0a48ebfc59..a8ffc4af66 100644
--- a/libs/gtkmm2ext/popup.cc
+++ b/libs/gtkmm2ext/popup.cc
@@ -73,11 +73,12 @@ PopUp::remove ()
{
hide ();
+ if (popdown_time != 0 && timeout != -1) {
+ gtk_timeout_remove (timeout);
+ }
+
if (delete_on_hide) {
std::cerr << "deleting prompter\n";
- if (popdown_time != 0 && timeout != -1) {
- gtk_timeout_remove (timeout);
- }
gtk_idle_add (idle_delete, this);
}
}
@@ -125,11 +126,12 @@ PopUp::on_delete_event (GdkEventAny* ev)
{
hide();
+ if (popdown_time != 0 && timeout != -1) {
+ gtk_timeout_remove (timeout);
+ }
+
if (delete_on_hide) {
std::cerr << "deleting prompter\n" << endl;
- if (popdown_time != 0 && timeout != -1) {
- gtk_timeout_remove (timeout);
- }
gtk_idle_add (idle_delete, this);
}