mirror of https://github.com/adamdruppe/arsd.git
allow setting label dynamically on button
This commit is contained in:
parent
c611f716bd
commit
52452f9da3
13
minigui.d
13
minigui.d
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue