Closed AllenDang closed 4 years ago
This PR contains following changes:
type NkGLFWClipbard struct { window *glfw.Window }
func NewGLFWClipboard(w glfw.Window) NkGLFWClipbard { return &NkGLFWClipbard{w} }
func (c *NkGLFWClipbard) SetText(content string) { c.window.SetClipboardString(content) }
func (c *NkGLFWClipbard) GetText() (string, error) { return c.window.GetClipboardString() }
func NkPlatformInit(win glfw.Window, opt PlatformInitOption) Context { .... state.ctx.SetClipboard(NewGLFWClipboard(win)) }
3. Add GetGoString to *TextEdit to ease the usage of NkEditBuffer.
Thank you for pushing this forward 💪🏼
This PR contains following changes:
func NewGLFWClipboard(w glfw.Window) NkGLFWClipbard { return &NkGLFWClipbard{w} }
func (c *NkGLFWClipbard) SetText(content string) { c.window.SetClipboardString(content) }
func (c *NkGLFWClipbard) GetText() (string, error) { return c.window.GetClipboardString() }
func NkPlatformInit(win glfw.Window, opt PlatformInitOption) Context { .... state.ctx.SetClipboard(NewGLFWClipboard(win)) }