#pragma once #include "gtkmm.h" #include #include #include #include #include class EntryBox : public Gtk::Box { public: class Entry : public Gtk::Entry { public: Entry(const std::string &content = "", std::function on_activate_ = nullptr, unsigned width_chars = -1); std::function on_activate; private: size_t selected_history; }; class Button : public Gtk::Button { public: Button(const std::string &label, std::function on_activate_ = nullptr); std::function on_activate; }; class ToggleButton : public Gtk::ToggleButton { public: ToggleButton(const std::string &label, std::function on_activate_ = nullptr); std::function on_activate; }; class Label : public Gtk::Label { public: Label(std::function update_ = nullptr); std::function update; }; private: EntryBox(); public: static EntryBox &get() { static EntryBox singleton; return singleton; } Gtk::Box upper_box; Gtk::Box lower_box; void clear(); void hide() { clear(); } void show(); std::list entries; std::list