]> git.tdb.fi Git - libs/gltk.git/blob - source/label.h
373e4e4af095d4440875cebad70c8f7497cea279
[libs/gltk.git] / source / label.h
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 #ifndef MSP_GLTK_LABEL_H_
9 #define MSP_GLTK_LABEL_H_
10
11 #include "widget.h"
12
13 namespace Msp {
14 namespace GLtk {
15
16 /**
17 Labels display static text.  There is one special part: "text".
18 */
19 class Label: public Widget
20 {
21 public:
22         class Loader: public Widget::Loader
23         {
24         public:
25                 Loader(Label &);
26                 Label &get_object();
27         };
28
29 private:
30         std::string text;
31
32 public:
33         Label(const Resources &, const std::string & =std::string());
34         void set_text(const std::string &);
35
36 private:
37         const char *get_class() const { return "label"; }
38         void render_part(const Part &) const;
39 };
40
41 } // namespace GLtk
42 } // namespace Msp
43
44 #endif