This commit is contained in:
Tig
2025-12-01 17:24:57 -07:00
parent f2a47367a5
commit 215d76645b
7 changed files with 61 additions and 36 deletions

View File

@@ -12,7 +12,7 @@ using Terminal.Gui.Views;
[assembly: ExampleMetadata ("Simple Example", "A basic login form demonstrating Terminal.Gui fundamentals")]
[assembly: ExampleCategory ("Getting Started")]
[assembly: ExampleDemoKeyStrokes (KeyStrokes = ["a", "d", "m", "i", "n", "Tab", "p", "a", "s", "s", "w", "o", "r", "d", "Enter"], Order = 1)]
[assembly: ExampleDemoKeyStrokes (KeyStrokes = ["a", "d", "m", "i", "n", "Tab", "p", "a", "s", "s", "w", "o", "r", "d", "Enter"], DelayMs = 500, Order = 1)]
[assembly: ExampleDemoKeyStrokes (KeyStrokes = ["Enter"], DelayMs = 500, Order = 2)]
[assembly: ExampleDemoKeyStrokes (KeyStrokes = ["Esc"], DelayMs = 100, Order = 3)]
@@ -20,9 +20,6 @@ using Terminal.Gui.Views;
ConfigurationManager.RuntimeConfig = """{ "Theme": "Light" }""";
ConfigurationManager.Enable (ConfigLocations.All);
// Setup automatic key injection for testing
ExampleContextInjector.SetupAutomaticInjection ();
// Check for test context to determine driver
string? contextJson = Environment.GetEnvironmentVariable (ExampleContext.ENVIRONMENT_VARIABLE_NAME);
string? driverName = null;
@@ -33,8 +30,12 @@ if (!string.IsNullOrEmpty (contextJson))
driverName = context?.DriverName;
}
IApplication app = Application.Create ().Init (driverName);
IApplication app = Application.Create ();
// Setup automatic key injection for testing
ExampleContextInjector.SetupAutomaticInjection (app);
app.Init (driverName);
app.Run<ExampleWindow> ();
// Dispose the app to clean up and enable Console.WriteLine below