Copy text to clipboard with button push #1321
-
How can I copy some text to the clipboard with a button push? I tried importing if ui.button("📋").clicked() {
let mut ctx = ClipboardContext::new().unwrap();
ctx.set_contents(sometext.to_string()).unwrap();
} but this does not work for me (clipboard is not updated). For some reason: if ui.button("📋").clicked() {
let mut ctx = ClipboardContext::new().unwrap();
ctx.set_contents(sometext.to_string()).unwrap();
ctx.get_contents().unwrap();
} does sort-of work, but I tried searching for a way to get a handle of |
Beta Was this translation helpful? Give feedback.
Answered by
SymmetricChaos
Mar 4, 2022
Replies: 1 comment 5 replies
-
I believe what you're looking for is
|
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
benruijl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe what you're looking for is