]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/button.cpp
Simplify constructors with C++11
[libs/gltk.git] / source / button.cpp
index fadd00a0cafedc4dd0d1996f8be7a0ec6ae8fdaf..0dd20c7a6abb841cd4d2f9e98d1b75030d912d98 100644 (file)
@@ -8,10 +8,7 @@ using namespace std;
 namespace Msp {
 namespace GLtk {
 
-Button::Button(const std::string &t):
-       text(),
-       icon(0),
-       pressed(false)
+Button::Button(const std::string &t)
 {
        input_type = INPUT_NAVIGATION;
        set_text(t);
@@ -33,13 +30,13 @@ void Button::set_text(const std::string &t)
 {
        text = t;
        signal_autosize_changed.emit();
-       rebuild();
+       mark_rebuild();
 }
 
 void Button::set_icon(const GL::Texture2D *i)
 {
        icon = i;
-       rebuild();
+       mark_rebuild();
 }
 
 void Button::rebuild_special(const Part &part)