Show / Hide Table of Contents

# Class Toplevel

Toplevel views can be modally executed.

##### Inheritance

System.Object
Responder
View
Toplevel
Window

##### Inherited Members

Responder.MouseEvent(MouseEvent)
View.Add(View)
View.Add(View[])
View.AddRune(Int32, Int32, Rune)
View.Bounds
View.ChildNeedsDisplay()
View.Clear()
View.Clear(Rect)
View.ClearNeedsDisplay()
View.ClipToBounds()
View.ColorScheme
View.DrawFrame(Rect, Int32, Boolean)
View.DrawHotString(ustring, Boolean, ColorScheme)
View.DrawHotString(ustring, Attribute, Attribute)
View.Driver
View.EnsureFocus()
View.Focused
View.FocusFirst()
View.FocusLast()
View.FocusNext()
View.FocusPrev()
View.Frame
View.GetEnumerator()
View.HasFocus
View.Height
View.Id
View.LayoutStyle
View.LayoutSubviews()
View.MostFocused
View.Move(Int32, Int32)
View.PositionCursor()
View.ProcessColdKey(KeyEvent)
View.ProcessHotKey(KeyEvent)
View.Redraw(Rect)
View.Remove(View)
View.RemoveAll()
View.ScreenToView(Int32, Int32)
View.SetClip(Rect)
View.SetFocus(View)
View.SetNeedsDisplay()
View.SetNeedsDisplay(Rect)
View.Subviews
View.SuperView
View.ToString()
View.WantMousePositionReports
View.Width
View.X
View.Y

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public class Toplevel : Terminal.Gui.View

##### Remarks

Toplevels can be modally executing views, and they return control to the caller when the "Running" property is set to false, or by calling Terminal.Gui.Application.RequestStop()

There will be a toplevel created for you on the first time use and can be accessed from the property Top, but new toplevels can be created and ran on top of it. To run, create the toplevel and then invoke Run() with the new toplevel.

### Constructors

#### Toplevel()

Initializes a new instance of the Toplevel class with Computed layout, defaulting to `async` full screen.

##### Declaration

    public Toplevel ();

#### Toplevel(Rect)

Initializes a new instance of the Toplevel class with the specified absolute layout.

##### Declaration

    public Toplevel (Terminal.Gui.Rect frame);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | frame | Frame.

### Fields

#### Running

This flag is checked on each iteration of the mainloop and it continues running until this flag is set to false.

##### Declaration

    public bool Running;

##### Field Value

Type | Description
--- | ---
System.Boolean | To be added.

### Properties

#### CanFocus

##### Declaration

    public override bool CanFocus { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean | To be added.

### Methods

#### Create()

Convenience factory method that creates a new toplevel with the current terminal dimensions.

##### Declaration

    public static Terminal.Gui.Toplevel Create ();

##### Returns

Type | Description
--- | ---
Toplevel | The create.

#### ProcessKey(KeyEvent)

##### Declaration

    public override bool ProcessKey (Terminal.Gui.KeyEvent keyEvent);

##### Parameters

Type | Name | Description
--- | --- | ---
KeyEvent | keyEvent | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

#### WillPresent()

This method is invoked by Application.Begin as part of the Application.Run after the views have been laid out, and before the views are drawn for the first time.

##### Declaration

    public virtual void WillPresent ();