<div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Wx::Button#set_default() I think does what you want, but I haven&#39;t tested it.</blockquote>
<div><br>It works.<br>&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
If you need to retrieve the Button object from the ButtonSizer to call this, you could use something like<br>
<br>
dialog.find_window(Wx::ID_OK)<br>
<br>
(in this case, to make &#39;OK&#39; the default selection)<br>
<br></blockquote></div><br>Just to let you know:<br>it doesn&#39;t works for me, i get this error:<br>undefined method &#39;find_window&#39; for #&lt;Views::Dialog::LoginDialog:0xc9e30d4&gt;<br><br>LoginDialog is a subclass of Wx::Dialog<br>
<br>I&#39;ve got it using xrcresource combinations methods:<br><br>Wx::Window.find_window_by_id(Wx::xrcid(&#39;wxID_OK&#39;), parent)<br><br>Thank you.<br><br>bio<br><br><br></div>