Class Window
Implements
System.Collections.IEnumerable
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)
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
public class Window : Toplevel, 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(ustring)
Initializes a new instance of the Window class with an optional title.
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 with the specified frame for its location, with the specified border,
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)
Declaration
public Window(Rect frame, ustring title = null)
Parameters
Type | Name | Description |
---|---|---|
Rect | frame | Superview-relatie 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 with the specified frame for its location, with the specified border,
and an optional title.
Declaration
public Window(Rect frame, ustring title = null, int padding = 0)
Parameters
Type | Name | Description |
---|---|---|
Rect | frame | Superview-relatie 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
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)
Adds a subview (child) to this view.
Declaration
public override void Add(View view)
Parameters
Type | Name | Description |
---|---|---|
View | view |
Overrides
Remarks
The Views that have been added to this view can be retrieved via the Subviews property. See also Remove(View) RemoveAll()
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)
Method invoked when a mouse event is generated
Declaration
public override bool MouseEvent(MouseEvent mouseEvent)
Parameters
Type | Name | Description |
---|---|---|
MouseEvent | mouseEvent | Contains the details about the mouse event. |
Returns
Type | Description |
---|---|
System.Boolean | true , if the event was handled, false otherwise. |
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
Remarks
Always use Bounds (view-relative) when calling Redraw(Rect), NOT Frame (superview-relative).
Views should set the color that they want to use on entry, as otherwise this will inherit the last color that was set globaly on the driver.
Overrides of Redraw(Rect) must ensure they do not set Driver.Clip
to a clip region
larger than the region
parameter.
Remove(View)
Removes a subview added via Add(View) or Add(View[]) from this View.
Declaration
public override void Remove(View view)
Parameters
Type | Name | Description |
---|---|---|
View | view |
Overrides
Remarks
RemoveAll()
Removes all subviews (children) added via Add(View) or Add(View[]) from this View.
Declaration
public override void RemoveAll()
Overrides
Implements
System.Collections.IEnumerable