Label
Display text.
| Header | #include "nativeui/label.h" |
| Namespace | namespace nu |
| Type | class (RefCounted) |
| Inherits | View |
Constructors
Label(const std::string& text)
Create a new Label with text.
Parameters
const std::string&text
Label(scoped_refptr<AttributedText> text)
Create a new Label with attributed text.
Parameters
Class properties
const char* kClassName
The class name of this view.
Methods
void SetText(const std::string& text)
Set the text to display.
Parameters
const std::string&text
std::string GetText() const
Return the text displayed.
Return
std::stringvoid SetAlign(TextAlign align)
Set horizontal text alignment.
Parameters
TextAlignalign
void SetVAlign(TextAlign align)
Set vertical text alignment.
Parameters
TextAlignalign
void SetAttributedText(scoped_refptr<AttributedText> text)
Set the attributed text to display.
Parameters
AttributedText* GetAttributedText() const
Return the attributed text displayed.
Return
AttributedText*