Files
Terminal.Gui/UICatalog/Scenarios/Generic.cs
Tig 574ed8fec7 Fixes #2469 - Revamp file structure and namespace (#2471)
* initial commit

* All tests pass

* Updated readme

* Revert "All tests pass"

This reverts commit 94ac462350.

* Revert "initial commit"

This reverts commit 36d92cc4e5.

* Moved Terminal.Gui files around

* Nuked .Graphs namespace

* Nuked .Graphs namespace

* Nuked .Trees namespace

* Nuked .Configuration namespace

* Nuked .Configuration namespace

* All tests pass

* tweaked tests

* removed unneeded usings

* re-enabled scrollview tests

* move scrollview test to ScrollViewTests

* Moved view navigation related tests to separate cs file

* Moved view scrollbarview related tests ScrollBarTestse

* Refactored View tests into smaller files

* Refactored driver tests

* Fixed a ton of BUGBUGs
2023-04-06 10:09:21 -06:00

43 lines
1.5 KiB
C#

using Terminal.Gui;
namespace UICatalog.Scenarios {
[ScenarioMetadata (Name: "Generic", Description: "Generic sample - A template for creating new Scenarios")]
[ScenarioCategory ("Controls")]
public class MyScenario : Scenario {
public override void Init ()
{
// The base `Scenario.Init` implementation:
// - Calls `Application.Init ()`
// - Adds a full-screen Window to Application.Top with a title
// that reads "Press <hotkey> to Quit". Access this Window with `this.Win`.
// - Sets the Theme & the ColorScheme property of `this.Win` to `colorScheme`.
// To override this, implement an override of `Init`.
//base.Init ();
// A common, alternate, implementation where `this.Win` is not used is below. This code
// leverages ConfigurationManager to borrow the color scheme settings from UICatalog:
Application.Init ();
ConfigurationManager.Themes.Theme = Theme;
ConfigurationManager.Apply ();
Application.Top.ColorScheme = Colors.ColorSchemes [TopLevelColorScheme];
}
public override void Setup ()
{
// Put scenario code here (in a real app, this would be the code
// that would setup the app before `Application.Run` is called`).
// With a Scenario, after UI Catalog calls `Scenario.Setup` it calls
// `Scenario.Run` which calls `Application.Run`. Example:
var button = new Button ("Press me!") {
AutoSize = false,
X = Pos.Center (),
Y = Pos.Center (),
};
Application.Top.Add (button);
}
}
}