From ea95d5559de8017300994c2866f3edb1578e717c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 3 Jun 2014 11:00:29 -0400 Subject: [PATCH] Migrated dialog_windows.go to the new string handling. --- dialog_windows.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dialog_windows.go b/dialog_windows.go index 9d529a5..91507d3 100644 --- a/dialog_windows.go +++ b/dialog_windows.go @@ -5,8 +5,6 @@ package ui import ( "fmt" "os" - "syscall" - "unsafe" ) // TODO change what the default window titles are? @@ -22,14 +20,16 @@ func _msgBox(primarytext string, secondarytext string, uType uint32) (result int text += "\n\n" + secondarytext } uType |= _MB_TASKMODAL // make modal to every window in the program (they're all windows of the uitask, which is a single thread) + ptext := toUTF16(text) + ptitle := toUTF16(os.Args[0]) ret := make(chan uiret) defer close(ret) uitask <- &uimsg{ call: _messageBox, p: []uintptr{ uintptr(_NULL), - uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(text))), - uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(os.Args[0]))), + utf16ToArg(ptext), + utf16ToArg(ptitle), uintptr(uType), }, ret: ret,