Class Toplevel | Terminal.Gui v2 (original) (raw)

Namespace

Terminal.Gui

Assembly

Terminal.Gui.dll

Toplevel views are used for both an application's main view (filling the entire screen and for modal (pop-up) views such as Dialog, MessageBox, and Wizard).

public class Toplevel : View, IDisposable, ISupportInitializeNotification, ISupportInitialize

Inheritance

Toplevel

Implements

Derived

Inherited Members

Remarks

Constructors

Toplevel()

Initializes a new instance of the Toplevel class, defaulting to full screen. The Width and Height properties will be set to the dimensions of the terminal using Fill(Dim).

Properties

IsLoaded

true if was already loaded by the Begin(Toplevel) false, otherwise.

MenuBar

Gets the latest MenuBar added into this Toplevel.

Modal

Determines whether the Toplevel is modal or not. If set to false (the default):

Running

Gets or sets whether the main loop for this Toplevel is running or not.

Methods

OnLoaded()

Called from Begin(Toplevel) before the Toplevel redraws for the first time.

PositionToplevel(Toplevel?)

Adjusts the location and size of top within this Toplevel. Virtual method enabling implementation of specific positions for inherited Toplevel views.

RequestStop()

Stops and closes this Toplevel. If this Toplevel is the top-most Toplevel,RequestStop(Toplevel?) will be called, causing the application to exit.

Events

Activate

Invoked when the Toplevel RunState active.

Closed

Invoked when the Toplevel's RunState is closed by End(RunState).

Closing

Invoked when the Toplevel's RunState is being closed byRequestStop(Toplevel?).

Deactivate

Invoked when the ToplevelRunState ceases to be active.

Loaded

Invoked when the Toplevel RunState has begun to be loaded. A Loaded event handler is a good place to finalize initialization before calling RunLoop(RunState).

Ready

Invoked when the Toplevel main loop has started it's first iteration. Subscribe to this event to perform tasks when the Toplevel has been laid out and focus has been set. changes.

A Ready event handler is a good place to finalize initialization after callingRun(Toplevel, Func<Exception, bool>?) on this Toplevel.

SizeChanging

Invoked when the terminal has been resized. The new Size of the terminal is provided.

Unloaded

Invoked when the Toplevel RunState has been unloaded. A Unloaded event handler is a good place to dispose objects after calling End(RunState).