summaryrefslogtreecommitdiff
path: root/uitask_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-03 10:02:27 -0400
committerPietro Gagliardi <[email protected]>2014-07-03 10:02:27 -0400
commit9eb9aa82c02a0276df38428895bd840ec8caea02 (patch)
tree5621f946a9eac5a7c7ee94f4f3be7990f85beb2d /uitask_windows.go
parent8a81650b3da7ce00725336df9e03b38e935c5a65 (diff)
Removed uitask and made the Window creation functions only callable from the main thread. This si the first part in the real major change, which bans all concurrent use of the API and provides a Post() function for communication. I don't like this, but it's the only way. Untested.
Diffstat (limited to 'uitask_windows.go')
-rw-r--r--uitask_windows.go28
1 files changed, 0 insertions, 28 deletions
diff --git a/uitask_windows.go b/uitask_windows.go
index 732e641..f260e79 100644
--- a/uitask_windows.go
+++ b/uitask_windows.go
@@ -29,32 +29,8 @@ const (
msgQuit = _WM_APP + iota + 1 // + 1 just to be safe
msgSetAreaSize
msgRepaintAll
- msgCreateWindow
)
-type uitaskParams struct {
- window *Window // createWindow
- control Control // createWindow
- show bool // createWindow
-}
-
-// SendMessage() won't return unti lthe deed is done, even if the deed is on another thread
-// SendMessage() does a thread switch if necessary
-// this also means we don't have to worry about the uitaskParams object being garbage collected
-
-func (_uitask) createWindow(w *Window, c Control, s bool) {
- uc := &uitaskParams{
- window: w,
- control: c,
- show: s,
- }
- _sendMessage.Call(
- uintptr(msghwnd),
- msgCreateWindow,
- uintptr(0),
- uintptr(unsafe.Pointer(uc)))
-}
-
func uiinit() error {
err := doWindowsInit()
if err != nil {
@@ -182,10 +158,6 @@ func messageHandlerWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPAR
// does not return a value according to MSDN
_postQuitMessage.Call(0)
return 0
- case msgCreateWindow:
- uc := (*uitaskParams)(unsafe.Pointer(lParam))
- uc.window.create(uc.control, uc.show)
- return 0
}
return defWindowProc(hwnd, uMsg, wParam, lParam)
}