How TextField support copy and paste #204
Answered
by
progrium
Charliego3
asked this question in
Q&A
-
How does the TextField support copy and paste events? |
Beta Was this translation helpful? Give feedback.
Answered by
progrium
Aug 24, 2023
Replies: 1 comment
-
They will have copy/paste events if you have a menu that include those operations. See our menu example: If you don't want a menu, you have to manually catch keypresses and do copy/paste operations: f := appkit.NewTextField()
f.CurrentEditor().Copy(nil)
f.CurrentEditor().Paste(nil) See our subclass example for one way to capture keypresses. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Charliego3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
They will have copy/paste events if you have a menu that include those operations. See our menu example:
https://github.com/progrium/macdriver/blob/main/macos/_examples/menu/main.go
If you don't want a menu, you have to manually catch keypresses and do copy/paste operations:
See our subclass example for one way to capture keypresses.