Table of Contents

Class ApplicationImpl

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

Implementation of core Application methods using the modern main loop architecture with component factories for different platforms.

public class ApplicationImpl : IApplication
Inheritance
ApplicationImpl
Implements
Inherited Members

Constructors

ApplicationImpl()

Creates a new instance of the Application backend.

Properties

CachedRunStateToplevel

Caches the Toplevel associated with the current RunState.

ClearScreenNextIteration

Gets or sets whether the screen will be cleared, and all Views redrawn, during the next Application iteration.

Driver

Gets or sets the console driver being used.

Force16Colors

Gets or sets whether Driver will be forced to output only the 16 colors defined in ColorName16. The default is false, meaning 24-bit (TrueColor) colors will be output as long as the selected IConsoleDriver supports TrueColor.

ForceDriver

Forces the use of the specified driver (one of "fake", "dotnet", "windows", or "unix"). If not specified, the driver is selected based on the platform.

Initialized

Gets or sets whether the application has been initialized.

Instance

Gets the currently configured backend implementation of Application gateway methods. Change to your own implementation by using ChangeInstance(IApplication) (before init).

IsLegacy

true if implementation is 'old'. false if implementation is cutting edge.

Keyboard

Handles keyboard input and key bindings at the Application level

Mouse

Handles mouse event state and processing.

Navigation

Gets or sets the navigation manager.

Popover

Gets or sets the popover manager.

Screen

Gets or sets the size of the screen. By default, this is the size of the screen as reported by the IConsoleDriver.

Sixel

Collection of sixel images to write out to screen when updating. Only add to this collection if you are sure terminal supports sixel format.

TimedEvents

Handles recurring events. These are invoked on the main UI thread - allowing for safe updates to View instances.

Top

Gets the currently active Toplevel.

TopLevels

Gets the stack of all Toplevels.

Methods

AddTimeout(TimeSpan, Func<bool>)

Adds a timeout to the application.

ChangeInstance(IApplication)

Change the singleton implementation, should not be called except before application startup. This method lets you provide alternative implementations of core static gateway methods of Application.

Init(IConsoleDriver?, string?)

Initializes a new instance of Terminal.Gui Application.

Invoke(Action)

Runs action on the main UI loop thread

LayoutAndDraw(bool)

Causes any Toplevels that need layout to be laid out. Then draws any Toplevels that need display. Only Views that need to be laid out (see NeedsLayout) will be laid out. Only Views that need to be drawn (see NeedsDraw) will be drawn.

RemoveTimeout(object)

Removes a previously scheduled timeout

RequestStop()

Requests that the application stop running.

RequestStop(Toplevel?)

Stops the provided Toplevel, causing or the top if provided.

Run(Func<Exception, bool>?, IConsoleDriver?)

Runs the application by creating a Toplevel object and calling Run(Toplevel, Func<Exception, bool>?).

Run(Toplevel, Func<Exception, bool>?)

Runs the Application using the provided Toplevel view.

Run<T>(Func<Exception, bool>?, IConsoleDriver?)

Runs the application by creating a Toplevel-derived object of type T and calling Run(Toplevel, Func<Exception, bool>?).

Shutdown()

Shutdown an application initialized with Init(IConsoleDriver?, string?).