diff --git a/newctrl/container_windows.c b/newctrl/container_windows.c index ea0a2f7..50ebc1e 100644 --- a/newctrl/container_windows.c +++ b/newctrl/container_windows.c @@ -13,13 +13,8 @@ If this is seriously an issue in the future, I can roll it back. static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - void *data; - RECT r; LRESULT lResult; - data = getWindowData(hwnd, uMsg, wParam, lParam, &lResult); - if (data == NULL) - return lResult; if (sharedWndProc(hwnd, uMsg, wParam, lParam, &lResult)) return lResult; switch (uMsg) { @@ -48,7 +43,7 @@ DWORD makeContainerWindowClass(char **errmsg) return 0; } -HWND newContainer(void *data) +HWND newContainer(void) { HWND hwnd; @@ -58,7 +53,7 @@ HWND newContainer(void *data) WS_CHILD | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100, - msgwin, NULL, hInstance, data); + msgwin, NULL, hInstance, NULL); if (hwnd == NULL) xpanic("container creation failed", GetLastError()); return hwnd; diff --git a/newctrl/container_windows.go b/newctrl/container_windows.go index 91aee8f..521b205 100644 --- a/newctrl/container_windows.go +++ b/newctrl/container_windows.go @@ -5,7 +5,6 @@ package ui import ( "fmt" "syscall" - "unsafe" ) // #include "winapi_windows.h" @@ -38,10 +37,10 @@ func makeContainerWindowClass() error { } func newContainer() *container { - c := new(container) - c.controlSingleHWND = newControlSingleHWND(C.newContainer(unsafe.Pointer(c))) // don't set preferredSize(); it should never be called - return c + return &container{ + controlSingleHWND: newControlSingleHWND(C.newContainer()), + } } // TODO merge with controlSingleHWND diff --git a/newctrl/winapi_windows.h b/newctrl/winapi_windows.h index 56f950d..9ee3994 100644 --- a/newctrl/winapi_windows.h +++ b/newctrl/winapi_windows.h @@ -123,7 +123,7 @@ extern void tableSelectItem(HWND, intptr_t); // container_windows.c extern DWORD makeContainerWindowClass(char **); -extern HWND newContainer(void *); +extern HWND newContainer(); extern void calculateBaseUnits(HWND, int *, int *, LONG *); // area_windows.c