]> git.tdb.fi Git - libs/gltk.git/blob - source/button.h
Rework event passing system to allow for pointer grabs
[libs/gltk.git] / source / button.h
1 #ifndef MSP_GLTK_BUTTON_H_
2 #define MSP_GLTK_BUTTON_H_
3
4 #include <sigc++/sigc++.h>
5 #include "widget.h"
6
7 namespace Msp {
8 namespace GLtk {
9
10 class Button: public Widget
11 {
12 public:
13         sigc::signal<void> signal_clicked;
14
15         Button(const Resources &, const std::string & =std::string());
16         void set_text(const std::string &);
17         void button_press(int, int, unsigned);
18         void button_release(int, int, unsigned);
19 private:
20         std::string text;
21         bool pressed;
22
23         const char *get_class() const { return "button"; }
24         void render_part(const Part &) const;
25 };
26
27 } // namespace GLtk
28 } // namespace Msp
29
30 #endif