diff --git a/FSharpExample/Program.fs b/FSharpExample/Program.fs index acb47eb01..cc40033c1 100644 --- a/FSharpExample/Program.fs +++ b/FSharpExample/Program.fs @@ -27,7 +27,7 @@ type Box10x (x: int, y: int) = raise (NotImplementedException()) override this.Redraw (_: Rect) = - Application.Driver.SetAttribute Application.Current.ColorScheme.Focus + Application.Driver.SetAttribute this.ColorScheme.Focus do let mutable y = 0 while y < h do @@ -47,7 +47,7 @@ type Filler (rect: Rect) = new Filler () override this.Redraw (_: Rect) = - Application.Driver.SetAttribute Application.Current.ColorScheme.Focus + Application.Driver.SetAttribute this.ColorScheme.Focus let mutable f = this.Frame do let mutable y = 0 diff --git a/Terminal.Gui/Views/TextField.cs b/Terminal.Gui/Views/TextField.cs index fdd042da0..6ccbfc92d 100644 --- a/Terminal.Gui/Views/TextField.cs +++ b/Terminal.Gui/Views/TextField.cs @@ -48,13 +48,13 @@ namespace Terminal.Gui { /// Initial text contents. public TextField (string text) : this (ustring.Make (text)) { - Height = 1; + Initialize (); } /// /// Initializes a new instance of the class using positioning. /// - public TextField () : this (string.Empty) { } + public TextField () : this (string.Empty) { Initialize (); } /// /// Initializes a new instance of the class using positioning. @@ -80,6 +80,8 @@ namespace Terminal.Gui { void Initialize (ustring text, int w) { + Initialize (); + if (text == null) text = ""; @@ -91,6 +93,11 @@ namespace Terminal.Gui { WantMousePositionReports = true; } + void Initialize () + { + Height = 1; + } + /// public override bool OnLeave (View view) {