From b2fff1bbec956e9c63f37c5b9c1e60a2fa2d473b Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Thu, 9 May 2019 11:33:10 -0400 Subject: [PATCH] Fix build --- Terminal.Gui/Views/Menu.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Terminal.Gui/Views/Menu.cs b/Terminal.Gui/Views/Menu.cs index e7c9e686c..29741ae9d 100644 --- a/Terminal.Gui/Views/Menu.cs +++ b/Terminal.Gui/Views/Menu.cs @@ -131,13 +131,6 @@ namespace Terminal.Gui { maxW = Math.Max (l, maxW); } - current = -1; - for (int i = 0; i < items.Length; i++) { - if (items [i] != null) { - current = i; - break; - } - } return new Rect (x, y, maxW + 2, items.Length + 2); } @@ -145,6 +138,13 @@ namespace Terminal.Gui { { this.barItems = barItems; this.host = host; + current = -1; + for (int i = 0; i < barItems.Children.Length; i++) { + if (barItems.Children[i] != null) { + current = i; + break; + } + } ColorScheme = Colors.Menu; CanFocus = true; } @@ -205,7 +205,7 @@ namespace Terminal.Gui { current--; if (current < 0) current = barItems.Children.Length - 1; - } while (barItems.Children [current] == null) + } while (barItems.Children [current] == null); SetNeedsDisplay (); break; case Key.CursorDown: @@ -213,7 +213,7 @@ namespace Terminal.Gui { current++; if (current == barItems.Children.Length) current = 0; - } while (barItems.Children [current] == null) + } while (barItems.Children [current] == null); SetNeedsDisplay (); break; case Key.CursorLeft: