Expand description
Simulate a click on a widget.
Warning!
Please note that the click will “fail” if the window isn’t on top of all other windows (this is a common issue on OSX). Don’t forget to bring the button’s window on top by using:
ⓘ
window.activate_focus();
Example:
extern crate gtk;
#[macro_use]
extern crate gtk_test;
use gtk::{Button, prelude::ButtonExt};
gtk::init().expect("GTK init failed");
let but = Button::new();
but.connect_clicked(|_| {
println!("clicked");
});
gtk_test::click(&but);