We can add a button click event in gtk-rs like this
let btn: Button = builder.get_object("button1").expect("Cant get button");
btn.connect_clicked(|_| {
println!("Activated");
});
like the above code how can I add similar click event for entry box such that when I press the mouse on the entry box it should print pressed
. I tried this
let entry: Entry = builder.get_object("box1").expect("Cant get box");
entry.connect_icon_press(|_, _, _| {
println!("pressed");
});
The program is compiling without any error but when I clicked on the entry box I expected to see pressed
in terminal but instead there is nothing.