From 52452f9da3844a04b7b25a679a96279a198ef165 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Thu, 8 Feb 2018 17:34:42 -0500 Subject: [PATCH] allow setting label dynamically on button --- minigui.d | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/minigui.d b/minigui.d index b67e61e..5d1ba70 100644 --- a/minigui.d +++ b/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) {