Beispiel #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
}
Beispiel #2
0
func SetClipboardText(text string) int {
	cs := C.CString(text)
	defer C.free(unsafe.Pointer(cs))
	return int(C.SDL_SetClipboardText(cs))
}
Beispiel #3
0
// 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
}
Beispiel #4
0
func SetClipboardText(text string) int {
	_text := (C.CString)(text)
	defer C.SDL_free(unsafe.Pointer(_text))
	return (int)(C.SDL_SetClipboardText(_text))
}