#include "../include/InputDialog.hpp" #include namespace dchat { InputDialog::InputDialog(const char *title, const char *text, const char *acceptText, const char *cancelText) { set_title(title); Gtk::Box *box = get_content_area(); Gtk::Label *label = Gtk::manage(new Gtk::Label(text)); label->set_valign(Gtk::ALIGN_END); label->set_halign(Gtk::ALIGN_CENTER); box->pack_start(*label, true, true); entry.set_valign(Gtk::ALIGN_CENTER); entry.set_halign(Gtk::ALIGN_CENTER); entry.set_hexpand(true); box->pack_end(entry, true, true); add_button(acceptText, Gtk::RESPONSE_ACCEPT); add_button(cancelText, Gtk::RESPONSE_CANCEL); show_all(); set_size_request(300, 150); } Glib::ustring InputDialog::getInput() const { return entry.get_text(); } }