本文整理汇总了C#中Gtk.HBox.Destroy方法的典型用法代码示例。如果您正苦于以下问题:C# HBox.Destroy方法的具体用法?C# HBox.Destroy怎么用?C# HBox.Destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.HBox
的用法示例。
在下文中一共展示了HBox.Destroy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddPage
private void AddPage(Widget widget)
{
HBox hbox = new HBox();
hbox.PackStart(new Label("Label"));
Button closeButton = new Button("X");
closeButton.Relief = ReliefStyle.None;
closeButton.FocusOnClick = false;
closeButton.Clicked += delegate {
hbox.Destroy();
widget.Destroy();
};
hbox.PackStart(closeButton);
hbox.ShowAll();
notebook.AppendPage(widget, hbox);
notebook.ShowAll();
}
示例2: OnButtonPickDatePeriodClicked
protected void OnButtonPickDatePeriodClicked(object sender, EventArgs e)
{
#region Widget creation
Window parentWin = (Window)Toplevel;
var selectDate = new Dialog ("Укажите период", parentWin, DialogFlags.DestroyWithParent);
selectDate.Modal = true;
selectDate.AddButton ("Отмена", ResponseType.Cancel);
selectDate.AddButton ("Ok", ResponseType.Ok);
periodSummary = new Label();
selectDate.VBox.Add(periodSummary);
HBox hbox = new HBox (true, 6);
StartDateCalendar = new Calendar ();
StartDateCalendar.DisplayOptions = DisplayOptions;
StartDateCalendar.Date = StartDateOrNull ?? DateTime.Today;
StartDateCalendar.DaySelected += StartDateCalendar_DaySelected;
EndDateCalendar = new Calendar ();
EndDateCalendar.DisplayOptions = DisplayOptions;
EndDateCalendar.Date = EndDateOrNull ?? DateTime.Today;
EndDateCalendar.DaySelected += EndDateCalendar_DaySelected;
hbox.Add (StartDateCalendar);
hbox.Add (EndDateCalendar);
selectDate.VBox.Add (hbox);
selectDate.ShowAll ();
#endregion
int response = selectDate.Run ();
if (response == (int)ResponseType.Ok) {
startDate = StartDateCalendar.GetDate ();
endDate = EndDateCalendar.GetDate ();
OnPeriodChanged ();
}
#region Destroy
EndDateCalendar.Destroy ();
StartDateCalendar.Destroy ();
hbox.Destroy ();
selectDate.Destroy ();
#endregion
}