How to control wxMessageBox

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
maty
In need of some credit
In need of some credit
Posts: 8
Joined: Thu Mar 26, 2009 2:52 am

How to control wxMessageBox

Post by maty » Thu Apr 09, 2009 10:12 am

Hi Forum members,

Thank you for your everyday's support.
Btw, I have a question about wxMessageBox.
In my current program, I use wxMessageBox for error message.
When error occurs, the wxMessageBox with OK button appears.
Next, if the user pushs the OK button, the wxMessageBox disappears and the user can continue using the application.
But, in order to increase the usability, I'd like to change the way as follows;

1. Showing the wxMessageBox with no button
2. Application automatically closing(exit)

Unfortunately, I am a newbie for wxWidgets, so I have no idea to change as above.
I would appreciate it if you let me know how to do that way.

Thanks,

Maty

spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

Post by spectrum » Thu Apr 09, 2009 10:35 am

hi maty,

for personalized messages/behaviour, i would create my own class derived from wxDialog.

greetings
spectrum

maty
In need of some credit
In need of some credit
Posts: 8
Joined: Thu Mar 26, 2009 2:52 am

Post by maty » Thu Apr 09, 2009 12:18 pm

Hi spectrum-san,

Thank you for your quick reply.
I read the text book of wxWidgets, but I can't find out which style or event I should use.
If you know which style or event is effective, please let me know.

Thanks,

Maty

TrV
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 630
Joined: Wed Jul 04, 2007 1:12 pm

Post by TrV » Thu Apr 09, 2009 1:30 pm

wxMessageBox is a function which creates (what a discover?!) a message box.
Hence, it always has at least one button.

For "Application automatically closing(exit)", i don't understand what you're really looking for, can you explain furthermore.

Anyway, spectrum is right : use your own class derived from wxDialog (really not a big deal).

DavidHart
Site Admin
Site Admin
Posts: 4008
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Thu Apr 09, 2009 1:58 pm

Hi,
Anyway, spectrum is right : use your own class derived from wxDialog (really not a big deal).
For example (if I understand correctly, you want a self-closing dialog):
http://forums.wxwidgets.org/viewtopic.php?p=30949#30949

Regards,

David

Post Reply