Toplevel

open class Toplevel : View

Toplevel views provide both the basic keyboard navigation between views using cursor keys and tab keys and they also contain the drawing backing store for views that are added to it.

Toplevels are the views that are expected to be passed to Application.present to be rendered. It introduces an independent rendering chain, in addition to the View rendering chain.

Calling Application.requestStop will remove the last Toplevel from the execution stack, redrawing the screen contents if necessary.

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

To make a toplevel modal, set the modal property to true, this will prevent keyboard and mouse events to go to a previous toplevel.

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

    Declaration

    Swift

    public override init()
  • Factory method that creates a new toplevel with the current terminal dimensions.

    Declaration

    Swift

    public static func create() -> Toplevel
  • Gets or sets a value indicating whether this can focus.

    Declaration

    Swift

    public override var canFocus: Bool { get set }
  • Determines whether the TopLevel is modal or not. Causes Application.processKey to propagate keys upwards by default unless set totrue`

    Declaration

    Swift

    public var modal: Bool
  • Gets or sets the menu for this Toplevel

    Declaration

    Swift

    public var menuBar: MenuBar?
  • Gets or sets the status bar for this Toplevel

    Declaration

    Swift

    public var statusBar: StatusBar?
  • Declaration

    Swift

    public override func processKey(event: KeyEvent) -> Bool
  • Declaration

    Swift

    public override func processColdKey(event: KeyEvent) -> Bool
  • Declaration

    Swift

    public override func addSubview(_ view: View)
  • Declaration

    Swift

    public override func remove(_ view: View)
  • 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

    Swift

    public func willPresent()
  • Undocumented

    Declaration

    Swift

    public override var debugDescription: String { get }