diff --git a/Terminal.Gui/Drivers/ConsoleDriver.cs b/Terminal.Gui/Drivers/ConsoleDriver.cs
index 6285ca971..7ab4139f5 100644
--- a/Terminal.Gui/Drivers/ConsoleDriver.cs
+++ b/Terminal.Gui/Drivers/ConsoleDriver.cs
@@ -253,6 +253,8 @@ namespace Terminal.Gui {
/// ConsoleDriver is an abstract class that defines the requirements for a console driver. One implementation if the CursesDriver, and another one uses the .NET Console one.
///
public abstract class ConsoleDriver {
+ protected Action TerminalResized;
+
///
/// The current number of columns in the terminal.
///
@@ -323,6 +325,11 @@ namespace Terminal.Gui {
/// Background color identifier.
public abstract void SetColors (short foregroundColorId, short backgroundColorId);
+ public void SetTerminalResized(Action terminalResized)
+ {
+ TerminalResized = terminalResized;
+ }
+
///
/// Draws a frame on the specified region with the specified padding around the frame.
///
diff --git a/Terminal.Gui/Drivers/CursesDriver.cs b/Terminal.Gui/Drivers/CursesDriver.cs
index d63be806c..6697579b0 100644
--- a/Terminal.Gui/Drivers/CursesDriver.cs
+++ b/Terminal.Gui/Drivers/CursesDriver.cs
@@ -17,8 +17,6 @@ namespace Terminal.Gui {
/// This is the Curses driver for the gui.cs/Terminal framework.
///
public class CursesDriver : ConsoleDriver {
- Action terminalResized;
-
public override int Cols => Curses.Cols;
public override int Rows => Curses.Lines;
@@ -159,7 +157,7 @@ namespace Terminal.Gui {
if (code == Curses.KEY_CODE_YES) {
if (wch == Curses.KeyResize) {
if (Curses.CheckWinChange ()) {
- terminalResized ();
+ TerminalResized?.Invoke ();
return;
}
}
@@ -226,7 +224,7 @@ namespace Terminal.Gui {
Curses.Window.Standard.keypad (true);
reportableMouseEvents = Curses.mousemask (Curses.Event.AllEvents | Curses.Event.ReportMousePosition, out oldMouseEvents);
- this.terminalResized = terminalResized;
+ TerminalResized = terminalResized;
if (reportableMouseEvents.HasFlag (Curses.Event.ReportMousePosition))
StartReportingMouseMoves ();
diff --git a/Terminal.Gui/Views/Button.cs b/Terminal.Gui/Views/Button.cs
index 3143036b8..7304000e6 100644
--- a/Terminal.Gui/Views/Button.cs
+++ b/Terminal.Gui/Views/Button.cs
@@ -194,7 +194,7 @@ namespace Terminal.Gui {
public override bool ProcessKey (KeyEvent kb)
{
var c = kb.KeyValue;
- if (c == '\n' || c == ' ' || Rune.ToUpper ((Rune)c) == hot_key) {
+ if (c == '\n' || c == ' ' || Rune.ToUpper ((uint)c) == hot_key) {
if (Clicked != null)
Clicked ();
return true;