From e2b8fb81d64499b9a27b72b0cbb0c37f60e49c25 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 1 Aug 2014 19:27:12 -0400 Subject: [PATCH] Converted direct usages of C.setWindowText() in the Windows Control code into calls to the equivalent Control methods so the text length can be properly stored. --- redo/basicctrls_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redo/basicctrls_windows.go b/redo/basicctrls_windows.go index 1099a19..5c77085 100644 --- a/redo/basicctrls_windows.go +++ b/redo/basicctrls_windows.go @@ -20,7 +20,7 @@ func startNewButton(text string, style C.DWORD) *button { c := newControl(buttonclass, style | C.WS_TABSTOP, 0) - C.setWindowText(c.hwnd, toUTF16(text)) + c.setText(text) C.controlSetControlFont(c.hwnd) b := &button{ controlbase: c, @@ -138,7 +138,7 @@ func finishNewLabel(text string, standalone bool) *label { // controls are vertically aligned to the top by default (thanks Xeek in irc.freenode.net/#winapi) C.SS_NOPREFIX | C.SS_LEFTNOWORDWRAP, 0) - C.setWindowText(c.hwnd, toUTF16(text)) + c.setText(text) C.controlSetControlFont(c.hwnd) l := &label{ controlbase: c,