예제 #1
0
func (this *ControlBase) Invalidate(erase bool) {
	pRect := w32.GetClientRect(this.hwnd)
	if this.isForm {
		w32.InvalidateRect(this.hwnd, pRect, erase)
	} else {
		rc := ScreenToClientRect(this.hwnd, pRect)
		w32.InvalidateRect(this.hwnd, rc.GetW32Rect(), erase)
	}
}
예제 #2
0
파일: main.go 프로젝트: saintfish/d2d
func (app *DemoApp) WndProc(hwnd w32.HWND, msg uint, wParam, lParam uintptr) uintptr {
	if hwnd != app.hwnd {
		return w32.DefWindowProc(hwnd, msg, wParam, lParam)
	}
	switch msg {
	case w32.WM_SIZE:
		width := w32.LOWORD(uint(lParam))
		height := w32.HIWORD(uint(lParam))
		app.OnResize(width, height)
		return 0
	case w32.WM_DISPLAYCHANGE:
		w32.InvalidateRect(app.hwnd, nil, false)
		return 0
	case w32.WM_PAINT:
		app.OnRender()
		w32.ValidateRect(app.hwnd, nil)
		return 0
	case w32.WM_DESTROY:
		w32.PostQuitMessage(0)
		return 1
	}

	return w32.DefWindowProc(hwnd, msg, wParam, lParam)
}
예제 #3
0
func (this *Window) FlushImage() {
	w32.InvalidateRect(this.hwnd, nil, false)
	w32.UpdateWindow(this.hwnd)
}
예제 #4
0
파일: window.go 프로젝트: js-arias/sparta
// Update updates the window content.
func (win *window) Update() {
	w32.InvalidateRect(win.id, nil, true)
}