mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 07:29:56 +08:00
27 lines
463 B
Go
27 lines
463 B
Go
package application
|
|
|
|
type clipboardImpl interface {
|
|
setText(text string) bool
|
|
text() (string, bool)
|
|
}
|
|
|
|
type Clipboard struct {
|
|
impl clipboardImpl
|
|
}
|
|
|
|
func newClipboard() *Clipboard {
|
|
return &Clipboard{
|
|
impl: newClipboardImpl(),
|
|
}
|
|
}
|
|
|
|
func (c *Clipboard) SetText(text string) bool {
|
|
return InvokeSyncWithResult(func() bool {
|
|
return c.impl.setText(text)
|
|
})
|
|
}
|
|
|
|
func (c *Clipboard) Text() (string, bool) {
|
|
return InvokeSyncWithResultAndOther(c.impl.text)
|
|
}
|