testclipboard.go 366 B

1234567891011121314151617181920
  1. package test
  2. import "fyne.io/fyne/v2"
  3. type testClipboard struct {
  4. content string
  5. }
  6. func (c *testClipboard) Content() string {
  7. return c.content
  8. }
  9. func (c *testClipboard) SetContent(content string) {
  10. c.content = content
  11. }
  12. // NewClipboard returns a single use in-memory clipboard used for testing
  13. func NewClipboard() fyne.Clipboard {
  14. return &testClipboard{}
  15. }