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


C# Notebook.Remove方法代码示例

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


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

示例1: InsertTabPage

        public static CloserTabLabel InsertTabPage (Notebook book, Widget page, string label)
        {
            var tab = new CloserTabLabel () { Text = label };
            tab.Closer.Pressed += (sender, e) => {
                MainWindow.OnCloseSourceFile (tab.CloseKeyData);
                book.Remove (page); };
            book.InsertPage (page, tab, book.NPages);
            tab.ShowAll ();

            return tab;
        }
开发者ID:Money520,项目名称:XR.Baboon,代码行数:11,代码来源:CloserTabLabel.cs

示例2: Save

        /// <summary>
        /// Save the specified nb, Index and Filename.
        /// </summary>
        /// <param name='_nb'>
        /// Nb.
        /// </param>
        /// <param name='_Index'>
        /// Index.
        /// </param>
        /// <param name='_Filename'>
        /// Filename.
        /// </param>
        public static void Save(Notebook _nb, int _Index, string _Filename)
        {
            try {
                if (_Filename != "" && disable != true) {

                    ((libTerminus.cRegex)_nb.GetNthPage (_nb.Page)).Save (_Filename);
                    int current = _nb.Page;
                    string data = ((libTerminus.cRegex)_nb.GetNthPage (_nb.Page)).GetDataSourceBuffer ();
                    ((libTerminus.cRegex)_nb.GetNthPage (_nb.Page)).Saved = true;
                    ((libTerminus.cRegex)_nb.GetNthPage (_nb.Page)).setDataBuffer (data);
                    g_tmp = ((libTerminus.cRegex)_nb.GetNthPage (_nb.Page));
                    _nb.Remove (_nb.GetNthPage (_nb.Page));
                    AddTabFromFile (_nb, _Filename, current);
                    _nb.Page = current;

                }
            } catch (Exception ex) {
                MessageBox.Show (ex.Message, cTerminus.g_programName, ButtonsType.Close, MessageType.Error);
            }
        }
开发者ID:squarerootfury,项目名称:terminus,代码行数:32,代码来源:cTerminus.cs

示例3: CreateNewWindow

        Notebook CreateNewWindow(Notebook source, Widget page, int x, int y)
        {
            Helpers.ExternalWindow window;
            EventBox box;
            Notebook notebook;

            window = new Helpers.ExternalWindow ();
            if (page == timeline) {
                window.Title = Catalog.GetString ("Timeline");
            } else if (page == dashboardhpaned) {
                window.Title = Catalog.GetString ("Analysis dashboard");
            } else if (page == playspositionviewer1) {
                window.Title = Catalog.GetString ("Zonal tags viewer");
            }

            notebook = new Notebook ();
            notebook.ShowTabs = false;
            notebook.CanFocus = false;
            //notebook.Group = source.Group;

            window.Add (notebook);
            window.SetDefaultSize (page.Allocation.Width, page.Allocation.Height);
            window.Move (x, y);
            window.ShowAll ();
            activeWindows.Add (window);
            window.DeleteEvent += (o, args) => {
                Widget pa = notebook.CurrentPageWidget;
                activeWindows.Remove (window);
                notebook.Remove (pa);
                Visible = true;
                source.AppendPage (pa, null);
                notebookHelper.UpdateTabs ();
                notebook.Destroy ();
            };

            /* If we are remove the last visible page, hide the widget to
             * free the empty space for the rest of widgets */
            int visiblePages = 0;
            for (int i = 0; i < source.NPages; i++) {
                if (source.GetNthPage (i).Visible) {
                    visiblePages++;
                }
            }
            if (visiblePages == 1) {
                Visible = false;
            }
            return notebook;
        }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:48,代码来源:CodingWidget.cs


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