summaryrefslogtreecommitdiff
path: root/area_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-12 15:36:05 -0400
committerPietro Gagliardi <[email protected]>2014-04-12 15:36:05 -0400
commit0a1dcfa67fce337efee917d9f9d2b75ea27dfc11 (patch)
tree840b34efe724a869f9c7a109e84f0398d9544298 /area_windows.go
parent97b25425735a85cea29e9f4ca2334ae47a882ca1 (diff)
Made Areas on Windows flicker-free.
Diffstat (limited to 'area_windows.go')
-rw-r--r--area_windows.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/area_windows.go b/area_windows.go
index 432b231..3537a75 100644
--- a/area_windows.go
+++ b/area_windows.go
@@ -103,6 +103,8 @@ func paintArea(s *sysData) {
return
}
+ // TODO don't do the above, but always draw the background color?
+
r1, _, err := _beginPaint.Call(
uintptr(s.hwnd),
uintptr(unsafe.Pointer(&ps)))
@@ -595,6 +597,10 @@ func areaWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lPara
case _WM_PAINT:
paintArea(s)
return 0
+ case _WM_ERASEBKGND:
+ // don't draw a background; we'll do so when painting
+ // this is to make things flicker-free; see http://msdn.microsoft.com/en-us/library/ms969905.aspx
+ return 1
case _WM_HSCROLL:
// TODO make this unnecessary
if s != nil && s.hwnd != 0 { // this message can be sent before s is assigned properly
@@ -708,7 +714,7 @@ func registerAreaWndClass(s *sysData) (newClassName string, err error) {
hInstance: hInstance,
hIcon: icon,
hCursor: cursor,
- hbrBackground: areaBackgroundBrush,
+ hbrBackground: _HBRUSH(_NULL), // no brush; we handle WM_ERASEBKGND
}
ret := make(chan uiret)