本文整理汇总了C#中Gtk.Notebook.Destroy方法的典型用法代码示例。如果您正苦于以下问题:C# Notebook.Destroy方法的具体用法?C# Notebook.Destroy怎么用?C# Notebook.Destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Notebook
的用法示例。
在下文中一共展示了Notebook.Destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}