diff --git a/Example/demo.cs b/Example/demo.cs index ea16a33ee..6bc7deee0 100644 --- a/Example/demo.cs +++ b/Example/demo.cs @@ -365,7 +365,7 @@ static class Demo { #region Selection Demo - static void ListSelectionDemo () + static void ListSelectionDemo (bool multiple) { var d = new Dialog ("Selection Demo", 60, 20, new Button ("Ok", is_default: true) { Clicked = () => { Application.RequestStop (); } }, @@ -385,7 +385,7 @@ static class Demo { Width = Dim.Fill () - 4, Height = Dim.Fill () - 4, AllowsMarking = true, - AllowsMultipleSelection = false + AllowsMultipleSelection = multiple }; d.Add (msg, list); Application.Run (d); @@ -460,7 +460,8 @@ static class Demo { menuItems[3] }), new MenuBarItem ("_List Demos", new MenuItem [] { - new MenuItem ("Select Items", "", ListSelectionDemo), + new MenuItem ("Select Multiple Items", "", () => ListSelectionDemo (true)), + new MenuItem ("Select Single Item", "", () => ListSelectionDemo (false)), }), new MenuBarItem ("Test Menu and SubMenus", new MenuItem [] { new MenuItem ("SubMenu1Item1", @@ -513,18 +514,15 @@ static class Demo { win.Add (drag, dragText); #if false - var label = new Label ("Fitler") { - X = 2 - }; - var spacing = 20; + // This currently causes a stack overflow, because it is referencing a window that has not had its size allocated yet - var button = new Button ("apply") { - X = Pos.Right (label) + spacing + 2, - Y = 0 + var bottom = new Label ("This should go on the bottom!") { + X = Pos.Left (win), + Y = Pos.Bottom (win) }; + win.Add (bottom); #endif - top.Add (win); //top.Add (menu); top.Add (menu, statusBar, ml); diff --git a/Terminal.Gui/Core.cs b/Terminal.Gui/Core.cs index e89130556..e96b495c2 100644 --- a/Terminal.Gui/Core.cs +++ b/Terminal.Gui/Core.cs @@ -1268,8 +1268,10 @@ namespace Terminal.Gui { if (v.LayoutStyle == LayoutStyle.Computed) v.RelativeLayout (Frame); + v.LayoutSubviews (); v.layoutNeeded = false; + } layoutNeeded = false; } diff --git a/Terminal.Gui/Views/ListView.cs b/Terminal.Gui/Views/ListView.cs index 41d4bc135..762c002b4 100644 --- a/Terminal.Gui/Views/ListView.cs +++ b/Terminal.Gui/Views/ListView.cs @@ -277,7 +277,7 @@ namespace Terminal.Gui { Driver.AddRune(' '); } else { if (allowsMarking) { - Driver.AddStr (source.IsMarked (item) ? "[x] " : "[ ] "); + Driver.AddStr (source.IsMarked (item) ? (AllowsMultipleSelection ? "[x] " : "(o)") : (AllowsMultipleSelection ? "[ ] " : "( )")); } Source.Render(this, Driver, isSelected, item, col, row, f.Width-col); }