SystemConsole.cs 831 B

12345678910111213141516171819202122232425262728293031323334
  1. using Terminal.Gui;
  2. namespace UICatalog {
  3. [ScenarioMetadata (Name: "System Console", Description: "Not working - #518 - Enables System Console and exercises things")]
  4. [ScenarioCategory ("Bug Repro")]
  5. [ScenarioCategory ("Console")]
  6. class UseSystemConsole : Scenario {
  7. public override void Init (Toplevel top, ColorScheme colorScheme)
  8. {
  9. Application.UseSystemConsole = true;
  10. base.Init (top, colorScheme);
  11. }
  12. public override void RequestStop ()
  13. {
  14. base.RequestStop ();
  15. Application.UseSystemConsole = false;
  16. }
  17. public override void Run ()
  18. {
  19. base.Run ();
  20. }
  21. public override void Setup ()
  22. {
  23. Win.Add (new Button ("Press me!") {
  24. X = Pos.Center (),
  25. Y = Pos.Center (),
  26. Clicked = () => MessageBox.Query (20, 7, "Hi", "Neat?", "Yes", "No")
  27. });
  28. }
  29. }
  30. }