Class Application | Terminal.Gui v2 (original) (raw)
Namespace
Assembly
Terminal.Gui.dll
A static, singleton class representing the application. This class is the entry point for the application.
public static class Application
Inheritance
Application
Inherited Members
Examples
Application.Init();
var win = new Window()
{
Title = $"Example App ({Application.QuitKey} to quit)"
};
Application.Run(win);
win.Dispose();
Application.Shutdown();
Fields
Collection of sixel images to write out to screen when updating. Only add to this collection if you are sure terminal supports sixel format.
Properties
Gets or sets the key to activate arranging views using the keyboard.
Gets or sets whether the screen will be cleared, and all Views redrawn, during the next Application iteration.
Gets the IConsoleDriver that has been selected. See also ForceDriver.
Set to true to cause End(RunState) to be called after the first iteration. Set to false (the default) to cause the application to continue running until Application.RequestStop () is called.
Gets or sets whether Driver will be forced to output only the 16 colors defined inColorName16. The default is false, meaning 24-bit (TrueColor) colors will be output as long as the selected IConsoleDriver supports TrueColor.
Forces the use of the specified driver (one of "fake", "ansi", "curses", "net", or "windows"). If not specified, the driver is selected based on the platform.
Gets whether the application has been initialized with Init(IConsoleDriver?, string?) and not yet shutdown with Shutdown().
Disable or enable the mouse. The mouse is enabled by default.
Gets the Application-scoped key bindings.
Gets the view that grabbed the mouse (e.g. for dragging). When this is set, all mouse events will be routed to this view until the view calls UngrabMouse() or the mouse is released.
Gets the ApplicationNavigation instance for the current Application.
Alternative key to navigate forwards through views. Ctrl+Tab is the primary key.
Alternative key to navigate forwards through views. Ctrl+Tab is the primary key.
Gets the Application Popover manager.
Alternative key to navigate backwards through views. Shift+Ctrl+Tab is the primary key.
Alternative key to navigate backwards through views. Shift+Ctrl+Tab is the primary key.
Gets or sets the key to quit the application.
Gets or sets the size of the screen. By default, this is the size of the screen as reported by the IConsoleDriver.
Gets all cultures supported by the application without the invariant language.
The Toplevel that is currently active.
WantContinuousButtonPressedView
The current View object that wants continuous mouse button pressed events.
Methods
Adds specified idle handler function to main iteration processing. The handler function will be called once per iteration of the main loop after other events have been handled.
Adds a timeout to the application.
Building block API: Prepares the provided Toplevel for execution.
Building block API: completes the execution of a Toplevel that was started withBegin(Toplevel) .
Gets of list of IConsoleDriver types that are available.
Gets the most recent position of the mouse.
Grabs the mouse, forcing all mouse events to be routed to the specified view until UngrabMouse()is called.
Init(IConsoleDriver?, string?)
Initializes a new instance of a Terminal.Gui Application. Shutdown() must be called when the application is closing.
Runs action
on the thread that is processing events
InvokeCommand(Command, Key, KeyBinding)
Invokes an Application-bound commmand.
Invokes any commands bound at the Application-level to key
.
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.
OnSizeChanging(SizeChangedEventArgs)
Called when the application's size changes. Sets the size of all Toplevels and fires theSizeChanging event.
Called when the user presses a key (by the IConsoleDriver). Raises the cancelableKeyDown event, then calls NewKeyDownEvent(Key) on all top level views, and finally if the key was not handled, invokes any Application-scoped KeyBindings.
Called when the user releases a key (by the IConsoleDriver). Raises the cancelableKeyUpevent then calls NewKeyUpEvent(Key) on all top level views. Called after RaiseKeyDownEvent(Key).
Removes a previously scheduled timeout
Stops the provided Toplevel, causing or the top
if provided.
Run(Func<Exception, bool>?, IConsoleDriver?)
Runs the application by creating a Toplevel object and callingRun(Toplevel, Func<Exception, bool>?).
Run(Toplevel, Func<Exception, bool>?)
Runs the Application using the provided Toplevel view.
RunIteration(ref RunState, bool)
Run one application iteration.
Building block API: Runs the main loop for the created Toplevel.
Run(Func<Exception, bool>?, IConsoleDriver?)
Runs the application by creating a Toplevel-derived object of type T
and callingRun(Toplevel, Func<Exception, bool>?).
Shutdown an application initialized with Init(IConsoleDriver?, string?).
Gets a string representation of the Application as rendered by Driver.
Gets a string representation of the Application rendered by the provided IConsoleDriver.
Releases the mouse grab, so mouse events will be routed to the view on which the mouse is.
Wakes up the running application that might be waiting on input.
Events
Invoked after a view has grabbed the mouse.
Invoked when a view wants to grab the mouse; can be canceled.
This event is raised after the Init(IConsoleDriver?, string?) and Shutdown() methods have been called.
This event is raised on each iteration of the main loop.
Raised when the user presses a key.
Set Handled to true to indicate the key was handled and to prevent additional processing.
Raised when the user releases a key.
Set Handled to true to indicate the key was handled and to prevent additional processing.
Raised when a mouse event occurs. Can be cancelled by setting Handled to true.
Notify that a new RunState was created (Begin(Toplevel) was called). The token is created in Begin(Toplevel) and this event will be fired before that function exits.
Notify that an existent RunState is stopping (End(RunState) was called).
Invoked when the terminal's size changed. The new size of the terminal is provided.
Invoked after a view has un-grabbed the mouse.
Invoked when a view wants un-grab the mouse; can be canceled.