|
@@ -13,23 +13,12 @@ public class LineViewExample : Scenario
|
|
|
public override void Main ()
|
|
|
{
|
|
|
Application.Init ();
|
|
|
- // Setup - Create a top-level application window and configure it.
|
|
|
- Toplevel top = new ();
|
|
|
|
|
|
- var menu = new MenuBar
|
|
|
+ var appWindow = new Window()
|
|
|
{
|
|
|
- Menus =
|
|
|
- [
|
|
|
- new ("_File", new MenuItem [] { new ("_Quit", "", () => Quit ()) })
|
|
|
- ]
|
|
|
+ Title = GetQuitKeyAndName (),
|
|
|
};
|
|
|
- top.Add (menu);
|
|
|
|
|
|
- var appWindow = new Window ()
|
|
|
- {
|
|
|
- Y = 1,
|
|
|
- Height = Dim.Fill (1) // BUGBUG: what if StatusBar is taller than 1?
|
|
|
- };
|
|
|
appWindow.Add (new Label { Y = 1, Text = "Regular Line" });
|
|
|
|
|
|
// creates a horizontal line
|
|
@@ -78,22 +67,11 @@ public class LineViewExample : Scenario
|
|
|
|
|
|
appWindow.Add (verticalArrow);
|
|
|
|
|
|
- var statusBar = new StatusBar (
|
|
|
- new Shortcut []
|
|
|
- {
|
|
|
- new (Application.QuitKey, "Quit", Quit)
|
|
|
- }
|
|
|
- );
|
|
|
- top.Add (appWindow);
|
|
|
- top.Add (statusBar);
|
|
|
-
|
|
|
// Run - Start the application.
|
|
|
- Application.Run (top);
|
|
|
- top.Dispose ();
|
|
|
+ Application.Run (appWindow);
|
|
|
+ appWindow.Dispose ();
|
|
|
|
|
|
// Shutdown - Calling Application.Shutdown is required.
|
|
|
Application.Shutdown ();
|
|
|
}
|
|
|
-
|
|
|
- private void Quit () { Application.RequestStop (); }
|
|
|
}
|