]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/root.h
Allow custom tooltips at empty areas of a Root
[libs/gltk.git] / source / root.h
index 36efba794c064c4fd854b31fc21654716e196eb4..50445fecea3fd8a0bcc206de73561a1c229e05ef 100644 (file)
@@ -10,11 +10,14 @@ Distributed under the LGPL
 
 #include <sigc++/trackable.h>
 #include <msp/gbase/window.h>
+#include <msp/time/timestamp.h>
 #include "panel.h"
 
 namespace Msp {
 namespace GLtk {
 
+class Label;
+
 /**
 A Root is a special type of Panel that covers and entire Window and accepts
 input from it.  When created, a Root widget will take its size from the window
@@ -23,11 +26,20 @@ rendered to fill the window in order to get coordinates mapped correctly.
 */
 class Root: public Panel, public sigc::trackable
 {
+public:
+       sigc::signal<std::string, int, int> signal_tooltip;
+
 private:
        Graphics::Window &window;
+       Label *lbl_tooltip;
+       int pointer_x;
+       int pointer_y;
+       Msp::Time::TimeStamp tooltip_timeout;
+       Widget *tooltip_target;
 
 public:
        Root(const Resources &, Graphics::Window &);
+       void tick();
 private:
        virtual const char *get_class() const { return "root"; }
        void button_press_event(int, int, unsigned, unsigned);