Skip to content

How TextField support copy and paste #204

Answered by progrium
Charliego3 asked this question in Q&A
Discussion options

You must be logged in to vote

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:

f := appkit.NewTextField()
f.CurrentEditor().Copy(nil)
f.CurrentEditor().Paste(nil)

See our subclass example for one way to capture keypresses.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Charliego3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants