本文整理汇总了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;
}
示例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);
}
}
示例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;
}