3 This file is part of libmspgltk
4 Copyright © 2007, 2009 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 &);
36 const GL::Texture2D *icon;
40 sigc::signal<void> signal_clicked;
42 Button(const Resources &, const std::string & =std::string());
43 void set_text(const std::string &);
44 void set_icon(const GL::Texture2D *);
45 virtual void button_press(int, int, unsigned);
46 virtual void button_release(int, int, unsigned);
47 virtual void pointer_motion(int, int);
49 virtual const char *get_class() const { return "button"; }
50 virtual void render_special(const Part &) const;
52 virtual void on_style_change();