I was trying to make a button that would get the contents of an entry box and print it to the terminal but I couldn't really find anything that helped. Could anyone help me?
I looked for solutions but didn't really find anything.
let button = Button::builder() // button with the name of button
.label("button")
// other traits for the button would go here but I just wanted it to be simple
let user_input = gtk::Entry::buidler(); // text box with the name user_input
.placeholder_text()
button.connect_clicked(move |_| {
let final_input = user_input.text(); // when the button is clicked final_input will take on the text that is in the text box at the time of the button click.
println!("{}", final_input);
I found the answer. I'll put some example code.
}