示例#1
0
文件: video.go 项目: krig/Go-SDL2
func (w *Window) ShowSimpleMessageBox(flags uint32, title, message string) {
	ctitle, cmessage := C.CString(title), C.CString(message)
	C.SDL_ShowSimpleMessageBox(C.Uint32(flags), ctitle, cmessage, w.cWindow)

	C.free(unsafe.Pointer(ctitle))
	C.free(unsafe.Pointer(cmessage))
}
示例#2
0
文件: video.go 项目: flazz/go-sdl2
// ShowSimpleMessageBox (https://wiki.libsdl.org/SDL_ShowSimpleMessageBox)
func ShowSimpleMessageBox(flags uint32, title, message string, window *Window) error {
	_title := C.CString(title)
	defer C.free(unsafe.Pointer(_title))
	_message := C.CString(message)
	defer C.free(unsafe.Pointer(_message))
	if (int)(C.SDL_ShowSimpleMessageBox(C.Uint32(flags), _title, _message, window.cptr())) < 0 {
		return GetError()
	}
	return nil
}
示例#3
0
func (w *Window) ShowSimpleMessageBox(flags uint32, title, message string) {
	GlobalMutex.Lock()
	defer GlobalMutex.Unlock()

	ctitle, cmessage := C.CString(title), C.CString(message)
	C.SDL_ShowSimpleMessageBox(C.Uint32(flags), ctitle, cmessage, w.cWindow)

	C.free(unsafe.Pointer(ctitle))
	C.free(unsafe.Pointer(cmessage))
}