本文整理汇总了C#中Gtk.Window.AddEvents方法的典型用法代码示例。如果您正苦于以下问题:C# Window.AddEvents方法的具体用法?C# Window.AddEvents怎么用?C# Window.AddEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Window
的用法示例。
在下文中一共展示了Window.AddEvents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static int Main(string [] args)
{
Application.Init ();
Gtk.Window win = new Gtk.Window ("testing");
VBox vbox = new VBox (false, 10);
GroupSelector gs = new GroupSelector ();
gs.Counts = new int [] {20, 100, 123, 10, 5, 2, 3, 50, 8, 10, 22, 0, 55, 129, 120, 30, 14, 200, 21, 55};
gs.Mode = RangeType.Fixed;
vbox.PackStart (gs);
gs = new GroupSelector ();
gs.Counts = new int [] {20, 100, 123, 10, 5, 2, 3, 50, 8, 10, 22, 0, 55, 129, 120, 30, 14, 200, 21, 55};
gs.Mode = RangeType.Fixed;
vbox.PackStart (gs);
win.Add (vbox);
win.ShowAll ();
win.AddEvents ((int) EventMask.KeyPressMask);
win.KeyPressEvent += gs.HandleKeyPressEvent;
Application.Run ();
return 0;
}
示例2: ShowAt
public void ShowAt(int x, int y)
{
//if(win != null) KillMenu (true);
//foreach(ApplicationMenuItem item in items) item.Parent = this;
if(win == null)
{
win = new SyntheticWindow (WindowType.Popup);
win.Child = this;
win.Hidden += delegate { KillMenu (true); };
win.ShowAll ();
win.GdkWindow.Move (x, y - verticalWindowOffset);
win.ButtonPressEvent += delegate { KillMenu (true); };
win.AddEvents ((int)(Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask));
}
else
{
win.ShowAll ();
win.GdkWindow.Move (x, y - verticalWindowOffset);
}
Grab.Add (win);
Gdk.GrabStatus grabbed = Gdk.Pointer.Grab (win.GdkWindow, true, Gdk.EventMask.ButtonPressMask, null, null, 0);
if(grabbed != Gdk.GrabStatus.Success)
{
KillMenu (false);
return;
}
grabbed = Gdk.Keyboard.Grab (win.GdkWindow, true, 0);
if(grabbed != Gdk.GrabStatus.Success)
{
KillMenu (false);
return;
}
}