Class Toplevel
Toplevel views can be modally executed.
Inheritance
System.Object
Toplevel
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Terminal.Gui.dll
Syntax
public class Toplevel : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Constructors
Toplevel()
Initializes a new instance of the
Toplevel class with
Computed layout, defaulting to full screen.
Declaration
Toplevel(Rect)
Initializes a new instance of the
Toplevel class with the specified absolute layout.
Declaration
public Toplevel(Rect frame)
Parameters
Type |
Name |
Description |
Rect |
frame |
A superview-relative rectangle specifying the location and size for the new Toplevel |
Properties
CanFocus
Gets or sets a value indicating whether this
Toplevel can focus.
Declaration
public override bool CanFocus { get; }
Property Value
Type |
Description |
System.Boolean |
true if can focus; otherwise, false . |
Overrides
Gets or sets the menu for this Toplevel
Declaration
public MenuBar MenuBar { get; set; }
Property Value
Modal
Declaration
public bool Modal { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Running
Declaration
public bool Running { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
StatusBar
Gets or sets the status bar for this Toplevel
Declaration
public StatusBar StatusBar { get; set; }
Property Value
Methods
Add(View)
Adds a subview (child) to this view.
Declaration
public override void Add(View view)
Parameters
Type |
Name |
Description |
View |
view |
|
Overrides
Create()
Convenience factory method that creates a new Toplevel with the current terminal dimensions.
Declaration
public static Toplevel Create()
Returns
OnKeyDown(KeyEvent)
Declaration
public override bool OnKeyDown(KeyEvent keyEvent)
Parameters
Type |
Name |
Description |
KeyEvent |
keyEvent |
Contains the details about the key that produced the event. |
Returns
Type |
Description |
System.Boolean |
|
Overrides
OnKeyUp(KeyEvent)
Declaration
public override bool OnKeyUp(KeyEvent keyEvent)
Parameters
Type |
Name |
Description |
KeyEvent |
keyEvent |
Contains the details about the key that produced the event. |
Returns
Type |
Description |
System.Boolean |
|
Overrides
ProcessColdKey(KeyEvent)
This method can be overwritten by views that
want to provide accelerator functionality
(Alt-key for example), but without
interefering with normal ProcessKey behavior.
Declaration
public override bool ProcessColdKey(KeyEvent keyEvent)
Parameters
Type |
Name |
Description |
KeyEvent |
keyEvent |
Contains the details about the key that produced the event. |
Returns
Type |
Description |
System.Boolean |
|
Overrides
ProcessKey(KeyEvent)
If the view is focused, gives the view a
chance to process the keystroke.
Declaration
public override bool ProcessKey(KeyEvent keyEvent)
Parameters
Type |
Name |
Description |
KeyEvent |
keyEvent |
Contains the details about the key that produced the event. |
Returns
Type |
Description |
System.Boolean |
|
Overrides
Redraw(Rect)
Redraws this view and its subviews; only redraws the views that have been flagged for a re-display.
Declaration
public override void Redraw(Rect bounds)
Parameters
Type |
Name |
Description |
Rect |
bounds |
The bounds (view-relative region) to redraw. |
Overrides
Remove(View)
Declaration
public override void Remove(View view)
Parameters
Type |
Name |
Description |
View |
view |
|
Overrides
RemoveAll()
Declaration
public override void RemoveAll()
Overrides
WillPresent()
Invoked by
Begin(Toplevel) as part of the
Run(Toplevel) after
the views have been laid out, and before the views are drawn for the first time.
Declaration
public virtual void WillPresent()
Events
Loaded
Declaration
public event Action Loaded
Event Type
Type |
Description |
System.Action |
|
Ready
Fired once the Toplevel's
MainLoop 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 calling `
Run()(topLevel)`.
Declaration
public event Action Ready
Event Type
Type |
Description |
System.Action |
|
Unloaded
Declaration
public event Action Unloaded
Event Type
Type |
Description |
System.Action |
|
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize