Ejemplo n.º 1
0
// GetClipboardText (https://wiki.libsdl.org/SDL_GetClipboardText)
func GetClipboardText() (string, error) {
	text := C.SDL_GetClipboardText()
	if text == nil {
		return "", GetError()
	}
	defer C.SDL_free(unsafe.Pointer(text))
	_text := C.GoString(text)
	return _text, nil
}
Ejemplo n.º 2
0
// GetClipboardText returns text from the clipboard.
//
// Note: A Window must be created before calling this function.
func GetClipboardText() (text string, err error) {
	s := C.SDL_GetClipboardText()
	if s == nil {
		return "", getError()
	}
	defer C.SDL_free(unsafe.Pointer(s))
	text = C.GoString(s)
	return text, nil
}
Ejemplo n.º 3
0
func GetClipboardText() string {
	return C.GoString(C.SDL_GetClipboardText())
}
Ejemplo n.º 4
0
func GetClipboardText() string {
	ctext := C.SDL_GetClipboardText()
	defer C.SDL_free(unsafe.Pointer(ctext))

	return C.GoString(ctext)
}
Ejemplo n.º 5
0
// GetClipboardText (https://wiki.libsdl.org/SDL_GetClipboardText)
func GetClipboardText() string {
	text := C.SDL_GetClipboardText()
	defer C.SDL_free(unsafe.Pointer(text))
	_text := C.GoString(text)
	return _text
}