Beispiel #1
0
func init() {
	wde.BackendNewWindow = func(width, height int) (w wde.Window, err error) {
		w, err = NewWindow(width, height)
		return
	}
	wde.BackendRun = Run
	wde.BackendStop = Stop
	runtime.LockOSThread()
	C.initMacDraw()
	tasks = make(chan func(), 16)
}
Beispiel #2
0
func init() {
	wde.BackendNewWindow = func(width, height int) (w wde.Window, err error) {
		w, err = NewWindow(width, height)
		return
	}
	wde.BackendRun = Run
	wde.BackendStop = Stop
	runtime.LockOSThread()
	C.initMacDraw()
	SetAppName("go")

}
Beispiel #3
0
func init() {
	if DoItTheRightWay {
		runtime.LockOSThread()
	}
	C.initMacDraw()
	if !DoItTheRightWay {
		go func() {
			runtime.LockOSThread()
			<-appChanStart
			C.NSAppRun()
			appChanFinish <- true
		}()
	}
}
Beispiel #4
0
func init() {
	wde.BackendNewWindow = func(width, height int) (w wde.Window, err error) {
		w, err = NewWindow(width, height)
		return
	}
	wde.BackendRun = Run
	wde.BackendStop = Stop
	runtime.LockOSThread()
	mdata, wdata := setupNibs()
	C.initMacDraw(
		unsafe.Pointer(&mdata[0]),
		C.int(len(mdata)),
		unsafe.Pointer(&wdata[0]),
		C.int(len(wdata)),
	)
	tasks = make(chan func(), 16)

	SetAppName("go")
}
Beispiel #5
0
func init() {
	wde.BackendNewWindow = func(width, height int) (w wde.Window, err error) {
		w, err = NewWindow(width, height)
		return
	}
	wde.BackendRun = Run
	wde.BackendStop = Stop
	wde.BackendGetClipboardText = GetClipboardText
	wde.BackendSetClipboardText = SetClipboardText

	runtime.LockOSThread()
	C.initMacDraw()
	SetAppName("go")

	// I'll uncomment these once the 'super' key glitch is fixed
	// wde.PasteChord = "super+v"
	// wde.CopyChord = "super+c"
	// wde.CutChord = "super+x"
}
Beispiel #6
0
func init() {
	runtime.LockOSThread()
	C.initMacDraw()
}