#ifndef JUCI_TOOLTIPS_H_ #define JUCI_TOOLTIPS_H_ #include "gtkmm.h" #include #include class Tooltip : public Gtk::Dialog { public: Tooltip(Gtk::TextView& text_view, const std::string& label_text, Glib::RefPtr start_mark, Glib::RefPtr end_mark, Gdk::Rectangle &tooltips_rectangle); void update(); void adjust(); Gtk::Label label; Glib::RefPtr start_mark; Glib::RefPtr end_mark; Gdk::Rectangle text_rectangle; private: Gtk::TextView& text_view; Gdk::Rectangle &tooltips_rectangle; }; class Tooltips { public: Tooltips(Gtk::TextView& text_view): text_view(text_view) {} void init_adjustments() {tooltips_rectangle=Gdk::Rectangle();} void clear() {tooltips.clear();} void add(const std::string& text, Glib::RefPtr start_mark, Glib::RefPtr end_mark); void show(const Gdk::Rectangle& rectangle); Gdk::Rectangle tooltips_rectangle; private: Gtk::TextView& text_view; std::vector > tooltips; }; #endif // JUCI_TOOLTIPS_H_