Created
August 25, 2018 15:59
-
-
Save lucasmeijer/ba4dc53205194b28691c2486b2f9497a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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