3 This file is part of libmspgltk
4 Copyright © 2007-2011 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_BUTTON_H_
9 #define MSP_GLTK_BUTTON_H_
11 #include <sigc++/sigc++.h>
12 #include <msp/gl/texture2d.h>
20 A clickable button widget. Buttons can have a text label, which is displayed
21 in a spacial part "text".
23 class Button: public Widget
26 class Loader: public Widget::Loader
31 void text(const std::string &);
34 sigc::signal<void> signal_clicked;
38 const GL::Texture2D *icon;
42 Button(const std::string & = std::string());
44 virtual const char *get_class() const { return "button"; }
46 virtual void autosize();
48 void set_text(const std::string &);
49 void set_icon(const GL::Texture2D *);
52 virtual void render_special(const Part &) const;
55 virtual void button_press(int, int, unsigned);
56 virtual void button_release(int, int, unsigned);
57 virtual void pointer_motion(int, int);
59 virtual void on_style_change();