mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
example/kitchen: add clipboard example
Updates gio#31 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -105,10 +105,18 @@ func loop(w *app.Window) error {
|
||||
select {
|
||||
case e := <-w.Events():
|
||||
switch e := e.(type) {
|
||||
case system.ClipboardEvent:
|
||||
lineEditor.SetText(e.Text)
|
||||
case system.DestroyEvent:
|
||||
return e.Err
|
||||
case system.FrameEvent:
|
||||
gtx.Reset(e.Queue, e.Config, e.Size)
|
||||
for iconButton.Clicked(gtx) {
|
||||
w.WriteClipboard(lineEditor.Text())
|
||||
}
|
||||
for flatBtn.Clicked(gtx) {
|
||||
w.ReadClipboard()
|
||||
}
|
||||
kitchen(gtx, th)
|
||||
e.Frame(gtx.Ops)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user