Gtk::Widget* PrefPage::appendEntry(const std::string& name, const std::string& registryKey) { Gtk::Alignment* alignment = Gtk::manage(new Gtk::Alignment(0.0, 0.5, 0.0, 0.0)); alignment->show(); Gtk::Entry* entry = Gtk::manage(new Gtk::Entry); entry->set_width_chars(static_cast<gint>(std::max(GlobalRegistry().get(registryKey).size(), std::size_t(30)))); alignment->add(*entry); // Connect the registry key to the newly created input field registry::bindPropertyToBufferedKey(entry->property_text(), registryKey, _registryBuffer, _resetValuesSignal); appendNamedWidget(name, *alignment); return entry; }
PropertyEditor::PropertyEditor(const char * key, Gtk::Entry &entry) : PropertyEditorBase(key, entry) { m_connection = entry.property_text().signal_changed().connect( sigc::mem_fun(*this, &PropertyEditor::on_changed)); }