Show / Hide Table of Contents

    Class Window

    A Toplevel View that draws a border around its Frame with a Title at the top.
    Inheritance
    System.Object
    Responder
    View
    Toplevel
    Window
    Dialog
    Implements
    System.IDisposable
    System.ComponentModel.ISupportInitializeNotification
    System.ComponentModel.ISupportInitialize
    System.Collections.IEnumerable
    Inherited Members
    Toplevel.Running
    Toplevel.Ready
    Toplevel.Create()
    Toplevel.CanFocus
    Toplevel.Modal
    Toplevel.MenuBar
    Toplevel.StatusBar
    Toplevel.OnKeyDown(KeyEvent)
    Toplevel.OnKeyUp(KeyEvent)
    Toplevel.ProcessKey(KeyEvent)
    Toplevel.WillPresent()
    View.Added
    View.Removed
    View.Enter
    View.Leave
    View.MouseEnter
    View.MouseLeave
    View.MouseClick
    View.HotKey
    View.HotKeySpecifier
    View.Driver
    View.Subviews
    View.TabIndexes
    View.TabIndex
    View.TabStop
    View.Id
    View.IsCurrentTop
    View.WantMousePositionReports
    View.WantContinuousButtonPressed
    View.Frame
    View.LayoutStyle
    View.Bounds
    View.X
    View.Y
    View.Width
    View.Height
    View.SuperView
    View.SetNeedsDisplay()
    View.SetNeedsDisplay(Rect)
    View.ChildNeedsDisplay()
    View.Add(View[])
    View.BringSubviewToFront(View)
    View.SendSubviewToBack(View)
    View.SendSubviewBackwards(View)
    View.BringSubviewForward(View)
    View.Clear()
    View.Clear(Rect)
    View.ScreenToView(Int32, Int32)
    View.ClipToBounds()
    View.SetClip(Rect)
    View.DrawFrame(Rect, Int32, Boolean)
    View.DrawHotString(ustring, Attribute, Attribute)
    View.DrawHotString(ustring, Boolean, ColorScheme)
    View.Move(Int32, Int32)
    View.PositionCursor()
    View.HasFocus
    View.OnAdded(View)
    View.OnRemoved(View)
    View.OnEnter(View)
    View.OnLeave(View)
    View.Focused
    View.MostFocused
    View.ColorScheme
    View.AddRune(Int32, Int32, Rune)
    View.ClearNeedsDisplay()
    View.DrawContent
    View.OnDrawContent(Rect)
    View.SetFocus(View)
    View.KeyPress
    View.ProcessHotKey(KeyEvent)
    View.ProcessColdKey(KeyEvent)
    View.KeyDown
    View.KeyUp
    View.EnsureFocus()
    View.FocusFirst()
    View.FocusLast()
    View.FocusPrev()
    View.FocusNext()
    View.LayoutStarted
    View.LayoutComplete
    View.Initialized
    View.LayoutSubviews()
    View.IsInitialized
    View.ToString()
    View.OnMouseEnter(MouseEvent)
    View.OnMouseLeave(MouseEvent)
    View.OnMouseEvent(MouseEvent)
    View.Dispose(Boolean)
    View.BeginInit()
    View.EndInit()
    Responder.Dispose()
    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)
    Namespace: Terminal.Gui
    Assembly: Terminal.Gui.dll
    Syntax
    public class Window : Toplevel, IDisposable, ISupportInitializeNotification, ISupportInitialize, IEnumerable
    Remarks
    The 'client area' of a Window is a rectangle deflated by one or more rows/columns from Bounds. A this time there is no API to determine this rectangle.

    Constructors

    Window()

    Initializes a new instance of the Window class using Computed positioning.
    Declaration
    public Window()

    Window(ustring)

    Initializes a new instance of the Window class with an optional title using Computed positioning.
    Declaration
    public Window(ustring title = null)
    Parameters
    Type Name Description
    NStack.ustring title Title.
    Remarks
    This constructor intitalize a View with a LayoutStyle of Computed. Use X, Y, Width, and Height properties to dynamically control the size and location of the view.

    Window(ustring, Int32)

    Initializes a new instance of the Window using Absolute positioning with the specified frame for its location, with the specified frame padding, and an optional title.
    Declaration
    public Window(ustring title = null, int padding = 0)
    Parameters
    Type Name Description
    NStack.ustring title Title.
    System.Int32 padding Number of characters to use for padding of the drawn frame.
    Remarks
    This constructor intitalize a View with a LayoutStyle of Computed. Use X, Y, Width, and Height properties to dynamically control the size and location of the view.

    Window(Rect, ustring)

    Initializes a new instance of the Window class with an optional title using Absolute positioning.
    Declaration
    public Window(Rect frame, ustring title = null)
    Parameters
    Type Name Description
    Rect frame Superview-relative rectangle specifying the location and size
    NStack.ustring title Title
    Remarks
    This constructor intitalizes a Window with a LayoutStyle of Absolute. Use constructors that do not take Rect parameters to initialize a Window with Computed.

    Window(Rect, ustring, Int32)

    Initializes a new instance of the Window using Absolute positioning with the specified frame for its location, with the specified frame padding, and an optional title.
    Declaration
    public Window(Rect frame, ustring title = null, int padding = 0)
    Parameters
    Type Name Description
    Rect frame Superview-relative rectangle specifying the location and size
    NStack.ustring title Title
    System.Int32 padding Number of characters to use for padding of the drawn frame.
    Remarks
    This constructor intitalizes a Window with a LayoutStyle of Absolute. Use constructors that do not take Rect parameters to initialize a Window with LayoutStyle of Computed

    Properties

    Text

    The text displayed by the Label.
    Declaration
    public override ustring Text { get; set; }
    Property Value
    Type Description
    NStack.ustring
    Overrides
    View.Text

    TextAlignment

    Controls the text-alignment property of the label, changing it will redisplay the Label.
    Declaration
    public override TextAlignment TextAlignment { get; set; }
    Property Value
    Type Description
    TextAlignment The text alignment.
    Overrides
    View.TextAlignment

    Title

    The title to be displayed for this window.
    Declaration
    public ustring Title { get; set; }
    Property Value
    Type Description
    NStack.ustring The title

    Methods

    Add(View)

    Declaration
    public override void Add(View view)
    Parameters
    Type Name Description
    View view
    Overrides
    Toplevel.Add(View)

    GetEnumerator()

    Enumerates the various Views in the embedded Terminal.Gui.Window.ContentView.
    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator The enumerator.

    MouseEvent(MouseEvent)

    Declaration
    public override bool MouseEvent(MouseEvent mouseEvent)
    Parameters
    Type Name Description
    MouseEvent mouseEvent
    Returns
    Type Description
    System.Boolean
    Overrides
    Responder.MouseEvent(MouseEvent)

    Redraw(Rect)

    Declaration
    public override void Redraw(Rect bounds)
    Parameters
    Type Name Description
    Rect bounds
    Overrides
    Toplevel.Redraw(Rect)

    Remove(View)

    Declaration
    public override void Remove(View view)
    Parameters
    Type Name Description
    View view
    Overrides
    Toplevel.Remove(View)

    RemoveAll()

    Declaration
    public override void RemoveAll()
    Overrides
    Toplevel.RemoveAll()

    Implements

    System.IDisposable
    System.ComponentModel.ISupportInitializeNotification
    System.ComponentModel.ISupportInitialize
    System.Collections.IEnumerable
    Back to top Generated by DocFX