本文整理汇总了C#中Gtk.HBox.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.HBox.Remove方法的具体用法?C# Gtk.HBox.Remove怎么用?C# Gtk.HBox.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.HBox
的用法示例。
在下文中一共展示了Gtk.HBox.Remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public Main(Controller.Main c)
: base(Gtk.WindowType.Toplevel)
{
ctl = c;
Name = "di";
Title = "di";
DefaultWidth = 800;
DefaultHeight = 600;
DeleteEvent += OnDeleteEvent;
topLevelBox = new Gtk.HBox();
topLevelBox.Homogeneous = false;
topLevelBox.Spacing = 20;
Add(topLevelBox);
windowsBox = new Gtk.HBox();
windowsBox.Homogeneous = true;
windowsBox.Spacing = 10;
foreach (var window in ctl.Windows)
{
var view = new WindowView(this, window);
windowsBox.Add(view);
}
topLevelBox.PackStart(windowsBox, true, true, 0);
ctl.Windows.Added.Add((index, window) =>
{
var view = new WindowView(this, window);
windowsBox.Add(view);
windowsBox.ShowAll();
});
ctl.Windows.Removed.Add((index, window) =>
{
var view = windowsBox.Children[index];
bool hadFocus = view.ContainsFocus();
windowsBox.Remove(view);
if (hadFocus && windowsBox.Children.Length > 0)
{
windowsBox.Children[0].GiveFocus();
}
});
ctl.Windows.Cleared.Add(() =>
{
foreach (var view in windowsBox.Children)
{
windowsBox.Remove(view);
}
});
ctl.Windows.CurrentChanged.Add((idx, win) => ApplyControllerFocus(win));
ctl.BeginTask.Add(task =>
{
var sidebar = Sidebar.Create(task);
topLevelBox.PackEnd(sidebar, false, false, 20);
task.End.Add(() =>
{
bool hadFocus = sidebar.ContainsFocus();
topLevelBox.Remove(sidebar);
if (hadFocus)
{
ApplyControllerFocus(ctl.Windows.Current);
}
});
sidebar.ShowAll();
});
}