Browse Source

Fix button

miguel 7 years ago
parent
commit
53b9350b2e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Terminal.Gui/Views/Button.cs

+ 2 - 0
Terminal.Gui/Views/Button.cs

@@ -65,6 +65,8 @@ namespace Terminal.Gui {
 		/// <param name="is_default">If set, this makes the button the default button in the current view, which means that if the user presses return on a view that does not handle return, it will be treated as if he had clicked on the button</param>
 		/// <param name="is_default">If set, this makes the button the default button in the current view, which means that if the user presses return on a view that does not handle return, it will be treated as if he had clicked on the button</param>
 		public Button (ustring text, bool is_default = false) : base ()
 		public Button (ustring text, bool is_default = false) : base ()
 		{
 		{
+			CanFocus = true;
+			this.IsDefault = is_default;
 			Text = text;
 			Text = text;
 			int w = text.Length + 4 + (is_default ? 2 : 0);
 			int w = text.Length + 4 + (is_default ? 2 : 0);
 			Width = w;
 			Width = w;