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


C# Window.HideAll方法代码示例

本文整理汇总了C#中Gtk.Window.HideAll方法的典型用法代码示例。如果您正苦于以下问题:C# Window.HideAll方法的具体用法?C# Window.HideAll怎么用?C# Window.HideAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.Window的用法示例。


在下文中一共展示了Window.HideAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddNewWordToDic

        public static void AddNewWordToDic(object sender, EventArgs e)
        {
            var win = new Gtk.Window("Přidej slovo");
            win.SetPosition( WindowPosition.Mouse );
            Label l = new Label();
            l.Text = "Vloží slovo do aktuálně načteného slovníku, avšak nezmění zdroj (např. soubor dic.txt )";

            Entry entry = new Entry();
            Button b = new Button("Přidej");
            VBox vbox = new VBox();
            HBox hbox = new HBox();
            vbox.BorderWidth = 10;

            vbox.PackStart( l );
            vbox.PackEnd( hbox );

            hbox.PackStart( entry );
            hbox.PackEnd( b );

            b.Clicked += delegate {
                game.dictionary.Add( entry.Text );
                win.HideAll();
                win.Destroy();
                win.Dispose();
            };

            win.Add(vbox);
            win.ShowAll();
        }
开发者ID:Kedrigern,项目名称:scrabble,代码行数:29,代码来源:staticWindows.cs

示例2: CheckWordDialog

        public static void CheckWordDialog(object sender, EventArgs e)
        {
            var lab = new Gtk.Label("Zadejte slovo: ");
            var ent = new Gtk.Entry();
            var but = new Gtk.Button("OK");
            var div = new Gtk.HBox(false, 1 );
            div.PackStart( lab );
            div.Add( ent );
            div.PackEnd( but );
            var checkWin = new Gtk.Window( Gtk.WindowType.Popup );
            checkWin.Add ( div );
            checkWin.BorderWidth = 0;
            checkWin.Modal = true;
            checkWin.CanFocus = true;
            checkWin.SetPosition( WindowPosition.Mouse );
            checkWin.ShowAll();
            ent.Activated += delegate {
                but.Click();
            };
            but.Clicked += delegate {
                checkWin.HideAll();

                if( game.dictionary.Content( ent.Text ) ) {
                    Gtk.MessageDialog ans = new Gtk.MessageDialog(
                            game.Window,
                            DialogFlags.DestroyWithParent,
                            MessageType.Info,
                            ButtonsType.Close,
                            "Slovo \""+ent.Text+"\" <b>je</b> ve slovníku"
                        );
                    ans.Run();
                    ans.Destroy();
                }
                else {
                    Gtk.MessageDialog ans = new Gtk.MessageDialog(
                            game.Window,
                            DialogFlags.DestroyWithParent,
                            MessageType.Info,
                            ButtonsType.Close,
                            "Slovo \""+ent.Text+"\" <b>není</b> ve slovníku"
                        );
                    ans.Run();
                    ans.Destroy();
                }
                checkWin.Dispose();
                checkWin.Destroy();
            };

            checkWin.KeyPressEvent += delegate(object o, KeyPressEventArgs args) {
                switch( args.Event.Key ) {
                case Gdk.Key.Escape:
                    checkWin.HideAll();
                    checkWin.Dispose();
                    checkWin.Destroy();
                    break;
                case Gdk.Key.ISO_Enter:
                    but.Click();
                    break;
                }
            };
        }
开发者ID:Kedrigern,项目名称:scrabble,代码行数:61,代码来源:staticWindows.cs

示例3: NextPlayer

        public static void NextPlayer(string name)
        {
            var but = new Gtk.Button( );
            but.TooltipMarkup = "Po kliknutí bude hrát další hráč";
            HBox hbox = new HBox();
            global::Gtk.Image im = new global::Gtk.Image ();
            Label l = new Label();
            l.Markup = "Na tahu je hráč:\n <b>" + name + "</b>\n\nOK";
            hbox.PackStart( im );
            hbox.PackEnd( l );
            but.Add( hbox );
            var win = new Gtk.Window( Gtk.WindowType.Toplevel );

            but.Clicked += delegate {
                win.HideAll();
                win.Dispose();
                win.Destroy();
            };
            win.Add( but );
            win.Fullscreen();
            win.ShowAll();
        }
开发者ID:Kedrigern,项目名称:scrabble,代码行数:22,代码来源:staticWindows.cs


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