Back to Terminal Gui

Scheme Overview

docfx/includes/scheme-overview.md

2.0.11.2 KB
Original Source

A Scheme is named a mapping from VisualRoles (e.g. VisualRole.Focus) to Attributes, defining how a View should look based on its purpose (e.g. Menu or Dialog). @Terminal.Gui.SchemeManager.Schemes is a dictionary of Schemes, indexed by name.

A Scheme defines how Views look based on their semantic purpose. The following schemes are supported:

Scheme NameDescription
BaseThe base scheme used for most Views.
DialogThe dialog scheme; used for Dialog, MessageBox, and other views dialog-like views.
ErrorThe scheme for showing errors, such as in ErrorQuery.
MenuThe menu scheme; used for Terminal.Gui.Menu, MenuBar, and StatusBar.
AccentThe accent scheme; a secondary/alternate scheme for visual distinction. Used for panels, event logs, and any view that needs visual separation.

@Terminal.Gui.SchemeManager manages the set of available schemes and provides a set of convenience methods for getting the current scheme and for overriding the default values for these schemes.

csharp
Scheme dialogScheme = SchemeManager.GetScheme (Schemes.Dialog);

ConfigurationManager can be used to override the default values for these schemes and add additional schemes.