From ad8461d6aff56b8f8be16be2b710d9dc60ba54c6 Mon Sep 17 00:00:00 2001 From: miguel Date: Mon, 13 Apr 2020 13:45:27 -0400 Subject: [PATCH] Prevent crash on Linux/Mac introduced in 0.80 --- Example/Example.csproj | 2 +- Example/demo.cs | 12 ++++++++++++ Terminal.Gui/Drivers/CursesDriver.cs | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Example/Example.csproj b/Example/Example.csproj index dff1d63ad..dc751b396 100644 --- a/Example/Example.csproj +++ b/Example/Example.csproj @@ -21,7 +21,7 @@ prompt 4 true - x86 + x64 true diff --git a/Example/demo.cs b/Example/demo.cs index 4d1a3a265..ea16a33ee 100644 --- a/Example/demo.cs +++ b/Example/demo.cs @@ -512,6 +512,18 @@ static class Demo { }); win.Add (drag, dragText); +#if false + var label = new Label ("Fitler") { + X = 2 + }; + var spacing = 20; + + var button = new Button ("apply") { + X = Pos.Right (label) + spacing + 2, + Y = 0 + }; +#endif + top.Add (win); //top.Add (menu); diff --git a/Terminal.Gui/Drivers/CursesDriver.cs b/Terminal.Gui/Drivers/CursesDriver.cs index 212f4af46..2508051db 100644 --- a/Terminal.Gui/Drivers/CursesDriver.cs +++ b/Terminal.Gui/Drivers/CursesDriver.cs @@ -299,6 +299,12 @@ namespace Terminal.Gui { Colors.Error.HotNormal = Curses.A_BOLD | Curses.A_REVERSE; Colors.Error.HotFocus = Curses.A_REVERSE; } + Colors.TopLevel = new ColorScheme (); + + Colors.TopLevel.Normal = MakeColor (Curses.COLOR_GREEN, Curses.COLOR_BLACK); + Colors.TopLevel.Focus = MakeColor (Curses.COLOR_WHITE, Curses.COLOR_CYAN); + Colors.TopLevel.HotNormal = MakeColor (Curses.COLOR_YELLOW, Curses.COLOR_BLACK); + Colors.TopLevel.HotFocus = MakeColor (Curses.COLOR_YELLOW, Curses.COLOR_CYAN); } static int MapColor (Color color)