Push OK button when pressing enter

koen at vermeer.tv koen at vermeer.tv
Wed Dec 5 03:16:54 PST 2007


> On Tue, 4 Dec 2007 14:26:34 +0100 (CET) koen at vermeer.tv wrote:
>
>> I'm sure this is a FAQ (it feels like it's simple, but I just cannot
>> find
>> a way to accomplish it), but here it goes anyway: On a wxDialog, how do
>> I
>> set up things in such a way that when the user presses Enter, the OK
>> button is pushed?
>  Call SetDefault() on it.

Thanks for the reply. I did that for buttons, but I didn't realize that I
should to the same when using wxStdDialogButtonSizer. I currently do not
save the pointer to the buttons that I add to the wxStdDialogButtonSizer,
but I guess I'll have to if I want to call SetDefault() on it. Or can I
somehow retrieve the pointer to the buttons from wxStdDialogButtonSizer?

Best,
Koen






More information about the wx-users mailing list