Slint Rust : How does the "paste()" function works on LineEdit ? #4910
Answered
by
ogoffart
Frank-schaefer
asked this question in
Q&A
-
As a Slint beginner. Is there an example how to use the paste() function with Rust on LineEdit in a ui.slint file ? |
Beta Was this translation helpful? Give feedback.
Answered by
ogoffart
Mar 21, 2024
Replies: 1 comment 1 reply
-
Basically you can call this function from a callback. A basic example is this: import { Button, VerticalBox, LineEdit, HorizontalBox } from "std-widgets.slint";
export component Demo {
VerticalBox {
alignment: start;
HorizontalBox {
alignment: center;
Button {
text: "Copy";
clicked => {l.copy()}
}
Button {
text: "Paste";
clicked => {l.paste()}
}
}
l := LineEdit {
text: "Hello";
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tronical
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basically you can call this function from a callback.
A basic example is this: