Function gtk_test::double_click
source · pub fn double_click<W: Clone + IsA<Object> + IsA<Widget> + WidgetExt>(
widget: &W
)
Expand description
Simulate a double-click on a widget.
Warning!
Please note that the double-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::{FileChooserAction, FileChooserWidget, prelude::FileChooserExt};
gtk::init().expect("GTK init failed");
let fcw = FileChooserWidget::new(FileChooserAction::Open);
fcw.connect_file_activated(|_| {
println!("double clicked");
});
gtk_test::double_click(&fcw);