]> git.tdb.fi Git - libs/gltk.git/blob - source/label.cpp
d0aba354c9555a86485640e6ded619463d4d1b84
[libs/gltk.git] / source / label.cpp
1 #include "label.h"
2 #include "part.h"
3
4 namespace Msp {
5 namespace GLtk {
6
7 Label::Label(const Resources &r, const std::string &t):
8         Widget(r)
9 {
10         set_text(t);
11         update_style();
12 }
13
14 void Label::set_text(const std::string &t)
15 {
16         text=t;
17 }
18
19 void Label::render_part(const Part &part) const
20 {
21         if(part.get_name()=="text")
22                 render_text(part, text);
23         else
24                 Widget::render_part(part);
25 }
26
27 } // namespace GLtk
28 } // namespace Msp