Notice if wxMessageBox pops up

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
richard_examion
Experienced Solver
Experienced Solver
Posts: 69
Joined: Wed Feb 27, 2019 7:17 am

Notice if wxMessageBox pops up

Post by richard_examion »

Hi there,

is there a way to notice, if a wxMessageBox pops up during run time?
Background: Certain configurations (ini files) of the program lead to message boxes showing up to inform the user about the situation.
However, when unittesting, this behaviour stops the whole testing process until someone hits the OK Button, which I would like to avoid...

Thanks - Richard
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Notice if wxMessageBox pops up

Post by doublemax »

Not possible. Maybe wrap all wxMessageBox calls in a function that you can bypass with a command line switch for testing.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Notice if wxMessageBox pops up

Post by ONEEYEMAN »

Hi,
Or use #ifdef.

Thank you.
richard_examion
Experienced Solver
Experienced Solver
Posts: 69
Joined: Wed Feb 27, 2019 7:17 am

Re: Notice if wxMessageBox pops up

Post by richard_examion »

Thanks anyway!
Post Reply