]> git.tdb.fi Git - libs/gltk.git/blob - source/label.cpp
0e0134d73766a4cb5f05830386d772790d6dca7d
[libs/gltk.git] / source / label.cpp
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include "label.h"
9 #include "part.h"
10
11 namespace Msp {
12 namespace GLtk {
13
14 Label::Label(const Resources &r, const std::string &t):
15         Widget(r)
16 {
17         set_text(t);
18         update_style();
19 }
20
21 void Label::set_text(const std::string &t)
22 {
23         text=t;
24 }
25
26 void Label::render_special(const Part &part) const
27 {
28         if(part.get_name()=="text")
29                 render_text(part, text);
30 }
31
32
33 Label::Loader::Loader(Label &l):
34         Widget::Loader(l)
35 {
36         add("text", &Label::text);
37 }
38
39 Label &Label::Loader::get_object()
40 {
41         return static_cast<Label &>(wdg);
42 }
43
44 } // namespace GLtk
45 } // namespace Msp