From ff7a68b2dc2a14ca092a5513ebb610007280dd3d Mon Sep 17 00:00:00 2001 From: BDisp Date: Sat, 13 Jul 2024 22:58:13 +0100 Subject: [PATCH] Change all Scenarios to merge their Init, Setup, and Run overrides into Main. --- UICatalog/Scenarios/ASCIICustomButton.cs | 2 +- UICatalog/Scenarios/ClassExplorer.cs | 28 ++++-- UICatalog/Scenarios/Clipping.cs | 20 ++--- .../Scenarios/CollectionNavigatorTester.cs | 25 +++--- UICatalog/Scenarios/CombiningMarks.cs | 48 +++++----- UICatalog/Scenarios/ComboBoxIteration.cs | 20 +++-- UICatalog/Scenarios/DynamicStatusBar.cs | 2 +- UICatalog/Scenarios/FileDialogExamples.cs | 66 +++++++------- UICatalog/Scenarios/Images.cs | 90 ++++++++++--------- UICatalog/Scenarios/InvertColors.cs | 17 +++- UICatalog/Scenarios/Keys.cs | 32 ++++--- UICatalog/Scenarios/LineDrawing.cs | 14 ++- UICatalog/Scenarios/LineViewExample.cs | 12 +-- UICatalog/Scenarios/ListColumns.cs | 17 ++-- UICatalog/Scenarios/ListsAndCombos.cs | 14 ++- UICatalog/Scenarios/Localization.cs | 33 ++++--- UICatalog/Scenarios/ProcessTable.cs | 18 ++-- UICatalog/Scenarios/Progress.cs | 17 ++-- UICatalog/Scenarios/SendKeys.cs | 30 ++++--- UICatalog/Scenarios/Snake.cs | 11 ++- UICatalog/Scenarios/Text.cs | 60 +++++++------ UICatalog/Scenarios/Threading.cs | 20 +++-- UICatalog/Scenarios/TileViewNesting.cs | 34 ++++--- UICatalog/Scenarios/TimeAndDate.cs | 32 ++++--- UICatalog/Scenarios/TreeViewFileSystem.cs | 24 +++-- UICatalog/Scenarios/VkeyPacketSimulator.cs | 34 ++++--- UICatalog/Scenarios/Wizards.cs | 23 +++-- 27 files changed, 442 insertions(+), 301 deletions(-) diff --git a/UICatalog/Scenarios/ASCIICustomButton.cs b/UICatalog/Scenarios/ASCIICustomButton.cs index 59e8924f0..8d25f9470 100644 --- a/UICatalog/Scenarios/ASCIICustomButton.cs +++ b/UICatalog/Scenarios/ASCIICustomButton.cs @@ -149,7 +149,7 @@ public class ASCIICustomButtonTest : Scenario public ScrollViewTestWindow () { - Title = "ScrollViewTestWindow"; + Title = $"{Application.QuitKey} to Quit - Scenario: ScrollViewTestWindow"; Label titleLabel = null; diff --git a/UICatalog/Scenarios/ClassExplorer.cs b/UICatalog/Scenarios/ClassExplorer.cs index 7cc3537f2..204ef01b5 100644 --- a/UICatalog/Scenarios/ClassExplorer.cs +++ b/UICatalog/Scenarios/ClassExplorer.cs @@ -17,11 +17,15 @@ public class ClassExplorer : Scenario private TextView _textView; private TreeView _treeView; - public override void Setup () + public override void Main () { - Win.Title = GetName (); - Win.Y = 1; // menu - Win.Height = Dim.Fill (1); // status bar + Application.Init (); + var top = new Toplevel (); + + var win = new Window + { + Title = GetName () + }; var menu = new MenuBar { @@ -55,15 +59,15 @@ public class ClassExplorer : Scenario ) ] }; - Top.Add (menu); + top.Add (menu); _treeView = new TreeView { X = 0, Y = 1, Width = Dim.Percent (50), Height = Dim.Fill () }; var lblSearch = new Label { Text = "Search" }; var tfSearch = new TextField { Width = 20, X = Pos.Right (lblSearch) }; - Win.Add (lblSearch); - Win.Add (tfSearch); + win.Add (lblSearch); + win.Add (tfSearch); TreeViewTextFilter filter = new (_treeView); _treeView.Filter = filter; @@ -83,11 +87,17 @@ public class ClassExplorer : Scenario _treeView.TreeBuilder = new DelegateTreeBuilder (ChildGetter, CanExpand); _treeView.SelectionChanged += TreeView_SelectionChanged; - Win.Add (_treeView); + win.Add (_treeView); _textView = new TextView { X = Pos.Right (_treeView), Y = 0, Width = Dim.Fill (), Height = Dim.Fill () }; - Win.Add (_textView); + win.Add (_textView); + + top.Add (win); + + Application.Run (top); + top.Dispose (); + Application.Shutdown (); } private bool CanExpand (object arg) { return arg is Assembly || arg is Type || arg is ShowForType; } diff --git a/UICatalog/Scenarios/Clipping.cs b/UICatalog/Scenarios/Clipping.cs index 94cfc4751..cdbc8155b 100644 --- a/UICatalog/Scenarios/Clipping.cs +++ b/UICatalog/Scenarios/Clipping.cs @@ -8,24 +8,16 @@ namespace UICatalog.Scenarios; [ScenarioCategory ("Scrolling")] public class Clipping : Scenario { - public override void Init () + public override void Main () { Application.Init (); - Top = new (); - Top.ColorScheme = Colors.ColorSchemes ["Base"]; - } + var win = new Window { Title = $"{Application.QuitKey} to Quit - Scenario: {GetName ()}" }; - public override void Setup () - { - //Win.X = 1; - //Win.Y = 2; - //Win.Width = Dim.Fill () - 4; - //Win.Height = Dim.Fill () - 2; var label = new Label { X = 0, Y = 0, Text = "ScrollView (new Rectangle (3, 3, 50, 20)) with a 200, 100 GetContentSize ()..." }; - Top.Add (label); + win.Add (label); var scrollView = new ScrollView { X = 3, Y = 3, Width = 50, Height = 20 }; scrollView.ColorScheme = Colors.ColorSchemes ["Menu"]; @@ -84,6 +76,10 @@ public class Clipping : Scenario scrollView.Add (embedded1); - Top.Add (scrollView); + win.Add (scrollView); + + Application.Run (win); + win.Dispose (); + Application.Shutdown (); } } diff --git a/UICatalog/Scenarios/CollectionNavigatorTester.cs b/UICatalog/Scenarios/CollectionNavigatorTester.cs index abdb2c3e1..0ae7a7628 100644 --- a/UICatalog/Scenarios/CollectionNavigatorTester.cs +++ b/UICatalog/Scenarios/CollectionNavigatorTester.cs @@ -74,19 +74,16 @@ public class CollectionNavigatorTester : Scenario "quitter" }.ToList ()); + private Toplevel top; private ListView _listView; private TreeView _treeView; // Don't create a Window, just return the top-level view - public override void Init () + public override void Main () { Application.Init (); - Top = new (); - Top.ColorScheme = Colors.ColorSchemes ["Base"]; - } + top = new Toplevel { ColorScheme = Colors.ColorSchemes ["Base"] }; - public override void Setup () - { var allowMarking = new MenuItem ("Allow _Marking", "", null) { CheckType = MenuItemCheckStyle.Checked, Checked = false @@ -128,14 +125,18 @@ public class CollectionNavigatorTester : Scenario ] }; - Top.Add (menu); + top.Add (menu); _items = new (_items.OrderBy (i => i, StringComparer.OrdinalIgnoreCase)); CreateListView (); var vsep = new LineView (Orientation.Vertical) { X = Pos.Right (_listView), Y = 1, Height = Dim.Fill () }; - Top.Add (vsep); + top.Add (vsep); CreateTreeView (); + + Application.Run (top); + top.Dispose (); + Application.Shutdown (); } private void CreateListView () @@ -149,7 +150,7 @@ public class CollectionNavigatorTester : Scenario Width = Dim.Percent (50), Height = 1 }; - Top.Add (label); + top.Add (label); _listView = new ListView { @@ -160,7 +161,7 @@ public class CollectionNavigatorTester : Scenario AllowsMarking = false, AllowsMultipleSelection = false }; - Top.Add (_listView); + top.Add (_listView); _listView.SetSource (_items); @@ -178,14 +179,14 @@ public class CollectionNavigatorTester : Scenario Width = Dim.Percent (50), Height = 1 }; - Top.Add (label); + top.Add (label); _treeView = new TreeView { X = Pos.Right (_listView) + 1, Y = Pos.Bottom (label), Width = Dim.Fill (), Height = Dim.Fill () }; _treeView.Style.HighlightModelTextOnly = true; - Top.Add (_treeView); + top.Add (_treeView); var root = new TreeNode ("IsLetterOrDigit examples"); diff --git a/UICatalog/Scenarios/CombiningMarks.cs b/UICatalog/Scenarios/CombiningMarks.cs index a6ee788da..b61ebb09f 100644 --- a/UICatalog/Scenarios/CombiningMarks.cs +++ b/UICatalog/Scenarios/CombiningMarks.cs @@ -6,33 +6,33 @@ namespace UICatalog.Scenarios; [ScenarioCategory ("Text and Formatting")] public class CombiningMarks : Scenario { - public override void Init () + public override void Main () { Application.Init (); - ConfigurationManager.Themes.Theme = Theme; + ConfigurationManager.Themes!.Theme = Theme; ConfigurationManager.Apply (); - Top = new (); - Top.ColorScheme = Colors.ColorSchemes [TopLevelColorScheme]; - } + var top = new Toplevel { ColorScheme = Colors.ColorSchemes [TopLevelColorScheme] }; - public override void Setup () - { - Top.DrawContentComplete += (s, e) => - { - Application.Driver.Move (0, 0); - Application.Driver.AddStr ("Terminal.Gui only supports combining marks that normalize. See Issue #2616."); - Application.Driver.Move (0, 2); - Application.Driver.AddStr ("\u0301\u0301\u0328<- \"\\u301\\u301\\u328]\" using AddStr."); - Application.Driver.Move (0, 3); - Application.Driver.AddStr ("[a\u0301\u0301\u0328]<- \"[a\\u301\\u301\\u328]\" using AddStr."); - Application.Driver.Move (0, 4); - Application.Driver.AddRune ('['); - Application.Driver.AddRune ('a'); - Application.Driver.AddRune ('\u0301'); - Application.Driver.AddRune ('\u0301'); - Application.Driver.AddRune ('\u0328'); - Application.Driver.AddRune (']'); - Application.Driver.AddStr ("<- \"[a\\u301\\u301\\u328]\" using AddRune for each."); - }; + top.DrawContentComplete += (s, e) => + { + Application.Driver.Move (0, 0); + Application.Driver.AddStr ("Terminal.Gui only supports combining marks that normalize. See Issue #2616."); + Application.Driver.Move (0, 2); + Application.Driver.AddStr ("\u0301\u0301\u0328<- \"\\u301\\u301\\u328]\" using AddStr."); + Application.Driver.Move (0, 3); + Application.Driver.AddStr ("[a\u0301\u0301\u0328]<- \"[a\\u301\\u301\\u328]\" using AddStr."); + Application.Driver.Move (0, 4); + Application.Driver.AddRune ('['); + Application.Driver.AddRune ('a'); + Application.Driver.AddRune ('\u0301'); + Application.Driver.AddRune ('\u0301'); + Application.Driver.AddRune ('\u0328'); + Application.Driver.AddRune (']'); + Application.Driver.AddStr ("<- \"[a\\u301\\u301\\u328]\" using AddRune for each."); + }; + + Application.Run (top); + top.Dispose (); + Application.Shutdown (); } } diff --git a/UICatalog/Scenarios/ComboBoxIteration.cs b/UICatalog/Scenarios/ComboBoxIteration.cs index 1d0cf9742..4cdabfcde 100644 --- a/UICatalog/Scenarios/ComboBoxIteration.cs +++ b/UICatalog/Scenarios/ComboBoxIteration.cs @@ -9,18 +9,20 @@ namespace UICatalog.Scenarios; [ScenarioCategory ("ComboBox")] public class ComboBoxIteration : Scenario { - public override void Setup () + public override void Main () { + Application.Init (); ObservableCollection items = ["one", "two", "three"]; + var win = new Window { Title = $"{Application.QuitKey} to Quit - Scenario: {GetName ()}" }; var lbListView = new Label { Width = 10, Height = 1 }; - Win.Add (lbListView); + win.Add (lbListView); var listview = new ListView { Y = Pos.Bottom (lbListView) + 1, Width = 10, Height = Dim.Fill (2), Source = new ListWrapper (items) }; - Win.Add (listview); + win.Add (listview); var lbComboBox = new Label { @@ -53,8 +55,8 @@ public class ComboBoxIteration : Scenario listview.SelectedItem = text.Item; } }; - Win.Add (lbComboBox, comboBox); - Win.Add (new TextField { X = Pos.Right (listview) + 1, Y = Pos.Top (comboBox) + 3, Height = 1, Width = 20 }); + win.Add (lbComboBox, comboBox); + win.Add (new TextField { X = Pos.Right (listview) + 1, Y = Pos.Top (comboBox) + 3, Height = 1, Width = 20 }); var btnTwo = new Button { X = Pos.Right (comboBox) + 1, Text = "Two" }; @@ -65,7 +67,7 @@ public class ComboBoxIteration : Scenario listview.SetSource (items); listview.SelectedItem = 0; }; - Win.Add (btnTwo); + win.Add (btnTwo); var btnThree = new Button { X = Pos.Right (comboBox) + 1, Y = Pos.Top (comboBox), Text = "Three" }; @@ -76,6 +78,10 @@ public class ComboBoxIteration : Scenario listview.SetSource (items); listview.SelectedItem = 0; }; - Win.Add (btnThree); + win.Add (btnThree); + + Application.Run (win); + win.Dispose (); + Application.Shutdown (); } } diff --git a/UICatalog/Scenarios/DynamicStatusBar.cs b/UICatalog/Scenarios/DynamicStatusBar.cs index 3c93421ee..551e4ad36 100644 --- a/UICatalog/Scenarios/DynamicStatusBar.cs +++ b/UICatalog/Scenarios/DynamicStatusBar.cs @@ -317,7 +317,7 @@ public class DynamicStatusBar : Scenario { DataContext = new DynamicStatusItemModel (); - Title = $"{Application.QuitKey} to Quit"; + Title = $"{Application.QuitKey} to Quit - Scenario: Dynamic StatusBar"; var _frmStatusBar = new FrameView { diff --git a/UICatalog/Scenarios/FileDialogExamples.cs b/UICatalog/Scenarios/FileDialogExamples.cs index 55fde0ca1..d98a0dcce 100644 --- a/UICatalog/Scenarios/FileDialogExamples.cs +++ b/UICatalog/Scenarios/FileDialogExamples.cs @@ -26,104 +26,110 @@ public class FileDialogExamples : Scenario private TextField _tbCancelButton; private TextField _tbOkButton; - public override void Setup () + public override void Main () { + Application.Init (); var y = 0; var x = 1; + var win = new Window { Title = $"{Application.QuitKey} to Quit - Scenario: {GetName ()}" }; _cbMustExist = new CheckBox { State = CheckState.Checked, Y = y++, X = x, Text = "Must Exist" }; - Win.Add (_cbMustExist); + win.Add (_cbMustExist); _cbUseColors = new CheckBox { State = FileDialogStyle.DefaultUseColors ? CheckState.Checked : CheckState.UnChecked, Y = y++, X = x, Text = "Use Colors" }; - Win.Add (_cbUseColors); + win.Add (_cbUseColors); _cbCaseSensitive = new CheckBox { State = CheckState.UnChecked, Y = y++, X = x, Text = "Case Sensitive Search" }; - Win.Add (_cbCaseSensitive); + win.Add (_cbCaseSensitive); _cbAllowMultipleSelection = new CheckBox { State = CheckState.UnChecked, Y = y++, X = x, Text = "Multiple" }; - Win.Add (_cbAllowMultipleSelection); + win.Add (_cbAllowMultipleSelection); _cbShowTreeBranchLines = new CheckBox { State = CheckState.Checked, Y = y++, X = x, Text = "Tree Branch Lines" }; - Win.Add (_cbShowTreeBranchLines); + win.Add (_cbShowTreeBranchLines); _cbAlwaysTableShowHeaders = new CheckBox { State = CheckState.Checked, Y = y++, X = x, Text = "Always Show Headers" }; - Win.Add (_cbAlwaysTableShowHeaders); + win.Add (_cbAlwaysTableShowHeaders); _cbDrivesOnlyInTree = new CheckBox { State = CheckState.UnChecked, Y = y++, X = x, Text = "Only Show Drives" }; - Win.Add (_cbDrivesOnlyInTree); + win.Add (_cbDrivesOnlyInTree); y = 0; x = 24; - Win.Add ( + win.Add ( new LineView (Orientation.Vertical) { X = x++, Y = 1, Height = 4 } ); - Win.Add (new Label { X = x++, Y = y++, Text = "Caption" }); + win.Add (new Label { X = x++, Y = y++, Text = "Caption" }); _rgCaption = new RadioGroup { X = x, Y = y }; _rgCaption.RadioLabels = new [] { "Ok", "Open", "Save" }; - Win.Add (_rgCaption); + win.Add (_rgCaption); y = 0; x = 34; - Win.Add ( + win.Add ( new LineView (Orientation.Vertical) { X = x++, Y = 1, Height = 4 } ); - Win.Add (new Label { X = x++, Y = y++, Text = "OpenMode" }); + win.Add (new Label { X = x++, Y = y++, Text = "OpenMode" }); _rgOpenMode = new RadioGroup { X = x, Y = y }; _rgOpenMode.RadioLabels = new [] { "File", "Directory", "Mixed" }; - Win.Add (_rgOpenMode); + win.Add (_rgOpenMode); y = 0; x = 48; - Win.Add ( + win.Add ( new LineView (Orientation.Vertical) { X = x++, Y = 1, Height = 4 } ); - Win.Add (new Label { X = x++, Y = y++, Text = "Icons" }); + win.Add (new Label { X = x++, Y = y++, Text = "Icons" }); _rgIcons = new RadioGroup { X = x, Y = y }; _rgIcons.RadioLabels = new [] { "None", "Unicode", "Nerd*" }; - Win.Add (_rgIcons); + win.Add (_rgIcons); - Win.Add (new Label { Y = Pos.AnchorEnd (2), Text = "* Requires installing Nerd fonts" }); - Win.Add (new Label { Y = Pos.AnchorEnd (1), Text = " (see: https://github.com/devblackops/Terminal-Icons)" }); + win.Add (new Label { Y = Pos.AnchorEnd (2), Text = "* Requires installing Nerd fonts" }); + win.Add (new Label { Y = Pos.AnchorEnd (1), Text = " (see: https://github.com/devblackops/Terminal-Icons)" }); y = 5; x = 24; - Win.Add ( + win.Add ( new LineView (Orientation.Vertical) { X = x++, Y = y + 1, Height = 4 } ); - Win.Add (new Label { X = x++, Y = y++, Text = "Allowed" }); + win.Add (new Label { X = x++, Y = y++, Text = "Allowed" }); _rgAllowedTypes = new RadioGroup { X = x, Y = y }; _rgAllowedTypes.RadioLabels = new [] { "Any", "Csv (Recommended)", "Csv (Strict)" }; - Win.Add (_rgAllowedTypes); + win.Add (_rgAllowedTypes); y = 5; x = 45; - Win.Add ( + win.Add ( new LineView (Orientation.Vertical) { X = x++, Y = y + 1, Height = 4 } ); - Win.Add (new Label { X = x++, Y = y++, Text = "Buttons" }); + win.Add (new Label { X = x++, Y = y++, Text = "Buttons" }); - Win.Add (new Label { X = x, Y = y++, Text = "Ok Text:" }); + win.Add (new Label { X = x, Y = y++, Text = "Ok Text:" }); _tbOkButton = new TextField { X = x, Y = y++, Width = 12 }; - Win.Add (_tbOkButton); - Win.Add (new Label { X = x, Y = y++, Text = "Cancel Text:" }); + win.Add (_tbOkButton); + win.Add (new Label { X = x, Y = y++, Text = "Cancel Text:" }); _tbCancelButton = new TextField { X = x, Y = y++, Width = 12 }; - Win.Add (_tbCancelButton); + win.Add (_tbCancelButton); _cbFlipButtonOrder = new CheckBox { X = x, Y = y++, Text = "Flip Order" }; - Win.Add (_cbFlipButtonOrder); + win.Add (_cbFlipButtonOrder); var btn = new Button { X = 1, Y = 9, Text = "Run Dialog" }; SetupHandler (btn); - Win.Add (btn); + win.Add (btn); + + Application.Run (win); + win.Dispose (); + Application.Shutdown (); } private void ConfirmOverwrite (object sender, FilesSelectedEventArgs e) diff --git a/UICatalog/Scenarios/Images.cs b/UICatalog/Scenarios/Images.cs index 40f24d7e2..d31eae9cc 100644 --- a/UICatalog/Scenarios/Images.cs +++ b/UICatalog/Scenarios/Images.cs @@ -15,14 +15,15 @@ namespace UICatalog.Scenarios; [ScenarioCategory ("Drawing")] public class Images : Scenario { - public override void Setup () + public override void Main () { - base.Setup (); + Application.Init (); + var win = new Window { Title = $"{Application.QuitKey} to Quit - Scenario: {GetName()}" }; bool canTrueColor = Application.Driver.SupportsTrueColor; var lblDriverName = new Label { X = 0, Y = 0, Text = $"Driver is {Application.Driver.GetType ().Name}" }; - Win.Add (lblDriverName); + win.Add (lblDriverName); var cbSupportsTrueColor = new CheckBox { @@ -32,7 +33,7 @@ public class Images : Scenario CanFocus = false, Text = "supports true color " }; - Win.Add (cbSupportsTrueColor); + win.Add (cbSupportsTrueColor); var cbUseTrueColor = new CheckBox { @@ -43,63 +44,68 @@ public class Images : Scenario Text = "Use true color" }; cbUseTrueColor.Toggle += (_, evt) => Application.Force16Colors = evt.NewValue == CheckState.UnChecked; - Win.Add (cbUseTrueColor); + win.Add (cbUseTrueColor); var btnOpenImage = new Button { X = Pos.Right (cbUseTrueColor) + 2, Y = 0, Text = "Open Image" }; - Win.Add (btnOpenImage); + win.Add (btnOpenImage); var imageView = new ImageView { X = 0, Y = Pos.Bottom (lblDriverName), Width = Dim.Fill (), Height = Dim.Fill () }; - Win.Add (imageView); + win.Add (imageView); btnOpenImage.Accept += (_, _) => - { - var ofd = new OpenDialog { Title = "Open Image", AllowsMultipleSelection = false }; - Application.Run (ofd); + { + var ofd = new OpenDialog { Title = "Open Image", AllowsMultipleSelection = false }; + Application.Run (ofd); - if (ofd.Path is { }) - { - Directory.SetCurrentDirectory (Path.GetFullPath (Path.GetDirectoryName (ofd.Path)!)); - } + if (ofd.Path is { }) + { + Directory.SetCurrentDirectory (Path.GetFullPath (Path.GetDirectoryName (ofd.Path)!)); + } - if (ofd.Canceled) - { - ofd.Dispose (); - return; - } + if (ofd.Canceled) + { + ofd.Dispose (); - string path = ofd.FilePaths [0]; + return; + } - ofd.Dispose (); + string path = ofd.FilePaths [0]; - if (string.IsNullOrWhiteSpace (path)) - { - return; - } + ofd.Dispose (); - if (!File.Exists (path)) - { - return; - } + if (string.IsNullOrWhiteSpace (path)) + { + return; + } - Image img; + if (!File.Exists (path)) + { + return; + } - try - { - img = Image.Load (File.ReadAllBytes (path)); - } - catch (Exception ex) - { - MessageBox.ErrorQuery ("Could not open file", ex.Message, "Ok"); + Image img; - return; - } + try + { + img = Image.Load (File.ReadAllBytes (path)); + } + catch (Exception ex) + { + MessageBox.ErrorQuery ("Could not open file", ex.Message, "Ok"); - imageView.SetImage (img); - Application.Refresh (); - }; + return; + } + + imageView.SetImage (img); + Application.Refresh (); + }; + + Application.Run (win); + win.Dispose (); + Application.Shutdown (); } private class ImageView : View diff --git a/UICatalog/Scenarios/InvertColors.cs b/UICatalog/Scenarios/InvertColors.cs index be8297cc6..8548793d1 100644 --- a/UICatalog/Scenarios/InvertColors.cs +++ b/UICatalog/Scenarios/InvertColors.cs @@ -10,9 +10,14 @@ namespace UICatalog.Scenarios; [ScenarioCategory ("Text and Formatting")] public class InvertColors : Scenario { - public override void Setup () + public override void Main () { - Win.ColorScheme = Colors.ColorSchemes ["TopLevel"]; + Application.Init (); + var win = new Window + { + Title = $"{Application.QuitKey} to Quit - Scenario: {GetName ()}", + ColorScheme = Colors.ColorSchemes ["TopLevel"] + }; List