io/input,io/clipboard: [API] replace WriteOp with command

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-10-09 18:27:01 -05:00
parent a3c539b3c2
commit d51aea553f
16 changed files with 67 additions and 62 deletions
+2 -9
View File
@@ -316,8 +316,8 @@ func (w *Window) processFrame(d driver) {
if hint, ok := q.TextInputHint(); ok {
d.SetInputHint(hint)
}
if txt, ok := q.WriteClipboard(); ok {
d.WriteClipboard(txt)
if mime, txt, ok := q.WriteClipboard(); ok {
d.WriteClipboard(mime, txt)
}
if q.ReadClipboard() {
d.ReadClipboard()
@@ -372,13 +372,6 @@ func (w *Window) Option(opts ...Option) {
}
}
// WriteClipboard writes a string to the clipboard.
func (w *Window) WriteClipboard(s string) {
w.driverDefer(func(d driver) {
d.WriteClipboard(s)
})
}
// Run f in the same thread as the native window event loop, and wait for f to
// return or the window to close. Run is guaranteed not to deadlock if it is
// invoked during the handling of a ViewEvent, system.FrameEvent,