From 8641dcdb0c7faf9164dc0bc992c3d70ee44ca7ef Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 5 Nov 2014 07:08:17 -0500 Subject: [PATCH] permit initial contents of a FloatingTextEntry --- gtk2_ardour/floating_text_entry.cc | 8 ++++++-- gtk2_ardour/floating_text_entry.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/floating_text_entry.cc b/gtk2_ardour/floating_text_entry.cc index 6808a1f2c1..a78f4a8200 100644 --- a/gtk2_ardour/floating_text_entry.cc +++ b/gtk2_ardour/floating_text_entry.cc @@ -25,14 +25,18 @@ #include "i18n.h" -FloatingTextEntry::FloatingTextEntry () +FloatingTextEntry::FloatingTextEntry (const std::string& initial_contents) : ArdourWindow ("") , entry_changed (false) { set_name (X_("FloatingTextEntry")); set_position (Gtk::WIN_POS_MOUSE); set_border_width (0); - + + if (!initial_contents.empty()) { + entry.set_text (initial_contents); + } + entry.show (); entry.signal_changed().connect (sigc::mem_fun (*this, &FloatingTextEntry::changed)); entry.signal_activate().connect (sigc::mem_fun (*this, &FloatingTextEntry::activated)); diff --git a/gtk2_ardour/floating_text_entry.h b/gtk2_ardour/floating_text_entry.h index 0471a19596..fc69085dfd 100644 --- a/gtk2_ardour/floating_text_entry.h +++ b/gtk2_ardour/floating_text_entry.h @@ -27,7 +27,7 @@ class FloatingTextEntry : public ArdourWindow { public: - FloatingTextEntry (); + FloatingTextEntry (const std::string& initial_contents); sigc::signal1 use_text;