Fabio Petrucci | 6 Oct 14:18

StdDialogButtonSizer default button

Hi all,

How do i set the default button for a Wx::StdDialogButtonSizer?

Any hints would be appreciated.

regards.

bio.
_______________________________________________
wxruby-users mailing list
wxruby-users <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
Alex Fenton | 6 Oct 14:36
Favicon

Re: StdDialogButtonSizer default button

Fabio Petrucci wrote:
> How do i set the default button for a Wx::StdDialogButtonSizer?
>
> Any hints would be appreciated.

Wx::Button#set_default() I think does what you want, but I haven't 
tested it.

If you need to retrieve the Button object from the ButtonSizer to call 
this, you could use something like

dialog.find_window(Wx::ID_OK)

(in this case, to make 'OK' the default selection)

alex
Fabio Petrucci | 6 Oct 15:22

Re: StdDialogButtonSizer default button


Wx::Button#set_default() I think does what you want, but I haven't tested it.

It works.
 

If you need to retrieve the Button object from the ButtonSizer to call this, you could use something like

dialog.find_window(Wx::ID_OK)

(in this case, to make 'OK' the default selection)


Just to let you know:
it doesn't works for me, i get this error:
undefined method 'find_window' for #<Views::Dialog::LoginDialog:0xc9e30d4>

LoginDialog is a subclass of Wx::Dialog

I've got it using xrcresource combinations methods:

Wx::Window.find_window_by_id(Wx::xrcid('wxID_OK'), parent)

Thank you.

bio


_______________________________________________
wxruby-users mailing list
wxruby-users <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users

Gmane