Default button for wxMessageBox

Is there a way to specify a default button (i.e. the button which has the focus) for a wxMessageBox? Currently, I have a wxYES_NO style, and the Yes button is always selected by default - I would like to make the No button the default.

The other option, of course is to build my own dialog...

Thanks,

···

--
Mark

According to the documentation there is the flag wxNO_DEFAULT which
(despite the somewhat strange name) should work as you described.

Markus

···

Am Die, den 20.01.2004 schrieb Mark Melvin um 23:51:

Is there a way to specify a default button (i.e. the button which has the
focus) for a wxMessageBox? Currently, I have a wxYES_NO style, and the
Yes button is always selected by default - I would like to make the No
button the default.

The other option, of course is to build my own dialog...

Thanks,

Markus,

Thanks for the tip - but that is for a wxMessageDialog class - not the built-in wxMessageBox function. Adding it to my call to wxMessageBox causes no message box to appear at all, as if the user just clicked No. Interesting...
Anyway - point taken - I'll just change the code to use an instance of wxMessageDialog, instead of calling wxMessageBox.

Thanks,
Mark.

···

On Tue, 20 Jan 2004 23:56:03 +0100, Markus Meyer <meyer@mesw.de> wrote:

According to the documentation there is the flag wxNO_DEFAULT which
(despite the somewhat strange name) should work as you described.

Markus

Am Die, den 20.01.2004 schrieb Mark Melvin um 23:51:

Is there a way to specify a default button (i.e. the button which has the
focus) for a wxMessageBox? Currently, I have a wxYES_NO style, and the
Yes button is always selected by default - I would like to make the No
button the default.

The other option, of course is to build my own dialog...

Sorry - I'm a tool. It works just fine. I had turned off printing to stdout, and I was actually getting an exception. When wxMessageDialog didn't work either it sort of tipped me off...

Thanks, Markus.

Mark.

···

------- Forwarded message -------
From: Mark Melvin <markm@digitalwizardry.ca>
To: "wxPython-users@lists.wxwindows.org" <wxPython-users@lists.wxwindows.org>
Subject: Re: Default button for wxMessageBox
Date: Wed, 21 Jan 2004 09:42:35 -0500

Markus,

Thanks for the tip - but that is for a wxMessageDialog class - not the built-in wxMessageBox function. Adding it to my call to wxMessageBox causes no message box to appear at all, as if the user just clicked No. Interesting...
Anyway - point taken - I'll just change the code to use an instance of wxMessageDialog, instead of calling wxMessageBox.

Thanks,
Mark.

On Tue, 20 Jan 2004 23:56:03 +0100, Markus Meyer <meyer@mesw.de> wrote:

According to the documentation there is the flag wxNO_DEFAULT which
(despite the somewhat strange name) should work as you described.

Markus

Am Die, den 20.01.2004 schrieb Mark Melvin um 23:51:

Is there a way to specify a default button (i.e. the button which has the
focus) for a wxMessageBox? Currently, I have a wxYES_NO style, and the
Yes button is always selected by default - I would like to make the No
button the default.

The other option, of course is to build my own dialog...