示例#1
0
// SetClipboardText (https://wiki.libsdl.org/SDL_SetClipboardText)
func SetClipboardText(text string) error {
	_text := C.CString(text)
	defer C.free(unsafe.Pointer(_text))
	if C.SDL_SetClipboardText(_text) < 0 {
		return GetError()
	}
	return nil
}
示例#2
0
文件: clipboard.go 项目: krig/Go-SDL2
func SetClipboardText(text string) int {
	cs := C.CString(text)
	defer C.free(unsafe.Pointer(cs))
	return int(C.SDL_SetClipboardText(cs))
}
示例#3
0
文件: clipboard.go 项目: salihdb/sdl
// SetClipboardText puts text into the clipboard.
//
// Note: A Window must be created before calling this function.
func SetClipboardText(text string) (err error) {
	if C.SDL_SetClipboardText(C.CString(text)) != 0 {
		return getError()
	}
	return nil
}
示例#4
0
func SetClipboardText(text string) int {
	_text := (C.CString)(text)
	defer C.SDL_free(unsafe.Pointer(_text))
	return (int)(C.SDL_SetClipboardText(_text))
}