Beispiel #1
0
func (s *screenImpl) NewWindow(opts *screen.NewWindowOptions) (screen.Window, error) {
	// TODO: look at opts.
	const width, height = 1024, 768

	id := C.newWindow(width, height)
	w := &windowImpl{
		s:        s,
		id:       uintptr(id),
		pump:     pump.Make(),
		endPaint: make(chan paint.Event, 1),
		draw:     make(chan struct{}),
		drawDone: make(chan struct{}),
	}

	s.mu.Lock()
	s.windows[uintptr(id)] = w
	s.mu.Unlock()

	go w.drawLoop(uintptr(C.showWindow(id)))

	return w, nil
}
Beispiel #2
0
func (w *Window) Show() {
	onMainThread(func() {
		C.showWindow(w.cw)
	})
}
Beispiel #3
0
func (w *Window) Show() {
	w.oplock.Lock()
	defer w.oplock.Unlock()

	C.showWindow(w.cw)
}
Beispiel #4
0
func (w *Window) Show() {
	C.showWindow(w.cw)
}
Beispiel #5
0
func (w *Window) showWindow() {
	C.showWindow(w.w)
}