From f7e45e8dea960971ca4533bbd94dc25ff21d5868 Mon Sep 17 00:00:00 2001 From: Charlie Kindel Date: Thu, 18 Jun 2020 07:35:08 -0700 Subject: [PATCH 1/2] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bbfd9fe28..ab8f83aae 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ![.NET Core](https://github.com/migueldeicaza/gui.cs/workflows/.NET%20Core/badge.svg?branch=master) +![Code scanning - action](https://github.com/migueldeicaza/gui.cs/workflows/Code%20scanning%20-%20action/badge.svg) [![Version](https://img.shields.io/nuget/v/Terminal.Gui.svg)](https://www.nuget.org/packages/Terminal.Gui) [![Downloads](https://img.shields.io/nuget/dt/Terminal.Gui)](https://www.nuget.org/packages/Terminal.Gui) [![License](https://img.shields.io/github/license/migueldeicaza/gui.cs.svg)](LICENSE) From 9b695799ab64a6fb68ec498cc1edfb3dd906c3f8 Mon Sep 17 00:00:00 2001 From: BDisp Date: Thu, 18 Jun 2020 16:34:12 +0100 Subject: [PATCH 2/2] Fixes #705 setting current Application.Top. --- Example/demo.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Example/demo.cs b/Example/demo.cs index ca9681517..1195db8ab 100644 --- a/Example/demo.cs +++ b/Example/demo.cs @@ -235,14 +235,14 @@ static class Demo { } // - // Creates a nested editor - static void Editor (Toplevel top) + static void Editor () { - var tframe = top.Frame; - var ntop = new Toplevel (tframe); + var tframe = Application.Top.Frame; + Application.Top.RemoveAll (); + var ntop = Application.Top; var menu = new MenuBar (new MenuBarItem [] { new MenuBarItem ("_File", new MenuItem [] { - new MenuItem ("_Close", "", () => {Application.RequestStop ();}), + new MenuItem ("_Close", "", () => { if (Quit ()) {Application.RequestStop (); } }), }), new MenuBarItem ("_Edit", new MenuItem [] { new MenuItem ("_Copy", "", null), @@ -273,7 +273,9 @@ static class Demo { text.Text = System.IO.File.ReadAllText (fname); win.Add (text); - Application.Run (ntop); + Application.Run (ntop, false); + Application.Top.RemoveAll (); + Main (); } static bool Quit () @@ -576,7 +578,7 @@ static class Demo { menu = new MenuBar (new MenuBarItem [] { new MenuBarItem ("_File", new MenuItem [] { - new MenuItem ("Text _Editor Demo", "", () => { Editor (top); }), + new MenuItem ("Text _Editor Demo", "", () => { Editor (); }), new MenuItem ("_New", "Creates new file", NewFile), new MenuItem ("_Open", "", Open), new MenuItem ("_Hex", "", () => ShowHex (top)),