当前位置: 首页>>代码示例>>C#>>正文


C# Window.AddEvents方法代码示例

本文整理汇总了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;
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:24,代码来源:GroupSelector.cs

示例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;
            }
        }
开发者ID:MASGAU,项目名称:gtk-sharp-ribbon,代码行数:40,代码来源:ApplicationMenu.cs


注:本文中的Gtk.Window.AddEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。