Skip to content

Instantly share code, notes, and snippets.

@lucasmeijer
Created August 25, 2018 15:59
Show Gist options
  • Save lucasmeijer/ba4dc53205194b28691c2486b2f9497a to your computer and use it in GitHub Desktop.
Save lucasmeijer/ba4dc53205194b28691c2486b2f9497a to your computer and use it in GitHub Desktop.
using Terminal.Gui;
static class Demo {
private static Window _firstWindow;
static void Main ()
{
Application.Init ();
int counter = 0;
_firstWindow = new Window("Platform") {Width = 20, Height = 20};
foreach (var plat in new[] {"OSX", "Windows", "XBox"})
_firstWindow.Add(new Button(plat) {Y = counter++, Clicked = ShowSecondWindow});
Application.Top.Add(_firstWindow);
Application.Run ();
}
static void ShowSecondWindow()
{
var window = new Window("SecondWindow") {X=20, Width = 20, Height = 20};
window.Add(new Label("I AM THE SECOND WINDOW"));
Application.Top.Add(window);
//also doesnt work if I remove the other window:
//Application.Top.Remove(_myWindow);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment