... I need peace
This commit is contained in:
parent
77e229fc8a
commit
b998c94f51
47 changed files with 2034 additions and 11979 deletions
39
yaxwtui/MainWindow.cs
Normal file
39
yaxwtui/MainWindow.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using Xwt;
|
||||
|
||||
namespace yaxwtui
|
||||
{
|
||||
public class MainWindow : Window
|
||||
{
|
||||
public MainWindow ()
|
||||
{
|
||||
Title = "yaxwtui";
|
||||
Width = 400;
|
||||
Height = 400;
|
||||
|
||||
Menu menu = new Menu ();
|
||||
|
||||
var file = new MenuItem ("_File");
|
||||
file.SubMenu = new Menu ();
|
||||
file.SubMenu.Items.Add (new MenuItem ("_Open"));
|
||||
file.SubMenu.Items.Add (new MenuItem ("_New"));
|
||||
MenuItem mi = new MenuItem ("_Close");
|
||||
mi.Clicked += (sender, e) => Close ();
|
||||
file.SubMenu.Items.Add (mi);
|
||||
menu.Items.Add (file);
|
||||
MainMenu = menu;
|
||||
|
||||
var sampleLabel = new Label ("yaxwtui");
|
||||
Content = sampleLabel;
|
||||
}
|
||||
|
||||
protected override bool OnCloseRequested ()
|
||||
{
|
||||
var allow_close = MessageDialog.Confirm ("yaxwtui will be closed", Command.Ok);
|
||||
if (allow_close)
|
||||
Application.Exit ();
|
||||
return allow_close;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue