本文整理汇总了C#中Gtk.Notebook.RemovePage方法的典型用法代码示例。如果您正苦于以下问题:C# Notebook.RemovePage方法的具体用法?C# Notebook.RemovePage怎么用?C# Notebook.RemovePage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Notebook
的用法示例。
在下文中一共展示了Notebook.RemovePage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TabWidget
public TabWidget(string tabName, Notebook nb, int index)
{
tabLabel = new Label(tabName);
this.PackStart (tabLabel, true, true, 3);
Button b = new Button (new Gtk.Image ("gtk-close", IconSize.Menu));
b.Relief = Gtk.ReliefStyle.None;
b.WidthRequest = b.HeightRequest = 24;
b.Clicked += delegate (object s, EventArgs a) {
if (CloseRequested != null)
CloseRequested(this, EventArgs.Empty);
nb.RemovePage(index);
};
this.PackStart (b, false, false, 0);
this.ShowAll();
}
示例2: CloseTab
/// <summary>
/// Closes the tab of the notebook and removes it from the <see cref="cTerminus.Files"/> List.
/// </summary>
/// <param name='_nb'>
/// The notebook
/// </param>
/// <param name='_index'>
/// The index of the current page, which should be deleted.
/// </param>
public static void CloseTab(Notebook _nb, int _index)
{
try {
if (((libTerminus.cRegex)_nb.GetNthPage (_nb.Page)).Saved) {
_nb.RemovePage (_index);
g_files.RemoveAt (_index);
} else if (((libTerminus.cRegex)_nb.GetNthPage (_nb.Page)).GetExpressionBuffer () == "") {
_nb.RemovePage (_index);
g_files.RemoveAt (_index);
} else {
if (AskForClosingLastTab () == ResponseType.Yes) {
_nb.RemovePage (_index);
g_files.RemoveAt (_index);
}
}
} catch (Exception ex) {
if (_nb.GetNthPage (_nb.Page) is cConfig) {
cTerminus.isConfigTabOpen = false;
cTerminus.ConfigTabIndex = -1;
} else if (_nb.GetNthPage (_nb.Page) is cPool) {
cTerminus.isLibTabOpen = false;
LibTabIndex = -1;
//Remove the tab
}
_nb.RemovePage (_index);
_nb.ParentWindow.Title = cTerminus.getTitle (_nb, _nb.Page);
}
}