浏览代码

Fix button

miguel 7 年之前
父节点
当前提交
53b9350b2e
共有 1 个文件被更改,包括 2 次插入0 次删除
  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>
 		public Button (ustring text, bool is_default = false) : base ()
 		{
+			CanFocus = true;
+			this.IsDefault = is_default;
 			Text = text;
 			int w = text.Length + 4 + (is_default ? 2 : 0);
 			Width = w;