当一个窗口聚焦时,GTK上的事件名称是什么? 谢谢
答案 0 :(得分:3)
也许, FocusIn ?
public class FocusTest {
private static void FocusInHandler (object obj, FocusInEventArgs args) {
Console.WriteLine("focus in");
}
private static void FocusOutHandler (object obj, FocusOutEventArgs args) {
Console.WriteLine("focus out");
}
public static void Main() {
Application.Init();
Window window = new Window("Focus test");
...
window.FocusInEvent += new FocusInEventHandler(FocusInHandler);
window.FocusOutEvent += new FocusOutEventHandler(FocusOutHandler);
...
window.ShowAll();
Application.Run();
}
}