[][src]Function gtk_test::enter_keys

pub fn enter_keys<W: Clone + IsA<Object> + IsA<Widget> + WidgetExt>(
    widget: &W,
    text: &str
)

Send keys event to the given widget.

Warning!

Please note that the enter-key event 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:

This example is not tested
window.activate_focus();

Example:

extern crate gtk;
#[macro_use]
extern crate gtk_test;

use gtk::{Entry, EntryExt};

gtk::init().expect("GTK init failed");
let entry = Entry::new();
entry.connect_preedit_changed(|_, _| {
    println!("key entered");
});
gtk_test::enter_keys(&entry, "A lot of keys!");