Skip to content

Commit

Permalink
Merge pull request #556 from BDisp/ui-toplevel-no-window-bug
Browse files Browse the repository at this point in the history
Fixes #437. Must explicit that is the current Top.
  • Loading branch information
tig authored May 27, 2020
2 parents 05c9ec7 + 6d99e31 commit 7e0d2f9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions UICatalog/Scenarios/TopLevelNoWindowBug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ class TopLevelNoWindowBug : Scenario {

public override void Run ()
{
var ntop = new Toplevel (new Rect (0, 0, Application.Driver.Cols, Application.Driver.Rows));
Top = new Toplevel (new Rect (0, 0, Application.Driver.Cols, Application.Driver.Rows));

var menu = new MenuBar (new MenuBarItem [] {
new MenuBarItem ("_Файл", new MenuItem [] {
new MenuItem ("_Создать", "Creates new file", null),
new MenuItem ("_Открыть", "", null),
new MenuItem ("Со_хранить", "", null),
new MenuItem ("_Выход", "", () => ntop.Running = false )
new MenuItem ("_Выход", "", () => Application.RequestStop())
}),
new MenuBarItem ("_Edit", new MenuItem [] {
new MenuItem ("_Copy", "", null),
new MenuItem ("C_ut", "", null),
new MenuItem ("_Paste", "", null)
})
});
ntop.Add (menu);
Top.Add (menu);

// BUGBUG: #437 This being commmented out causes menu to mis-behave
var win = new Window ($"Scenario: {GetName ()}") {
X = 0,
Y = 1,
Width = Dim.Fill (),
Height = Dim.Fill ()
};
ntop.Add (win);
// BUGBUG: #437 This being commented out causes menu to mis-behave
//var win = new Window ($"Scenario: {GetName ()}") {
// X = 0,
// Y = 1,
// Width = Dim.Fill (),
// Height = Dim.Fill ()
//};
//ntop.Add (win);

base.Run ();
}
Expand Down

0 comments on commit 7e0d2f9

Please sign in to comment.