allow setting label dynamically on button

This commit is contained in:
Adam D. Ruppe 2018-02-08 17:34:42 -05:00
parent c611f716bd
commit 52452f9da3
1 changed files with 12 additions and 1 deletions

View File

@ -4980,7 +4980,18 @@ class Button : MouseActivatedWidget {
}
else static assert(false);
private string label;
private string label_;
string label() { return label_; }
void label(string l) {
label_ = l;
version(win32_widgets) {
WCharzBuffer bfr = WCharzBuffer(l);
SetWindowTextW(hwnd, bfr.ptr);
} else version(custom_widgets) {
redraw();
}
}
version(win32_widgets)
this(string label, Widget parent = null) {