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;