ROUBEYRIE wrote:
The 'self.main.RunApp()' contains a 'try ... except ...' for testing if a file (.ini) is present. If not, I want to write in the log a message, wait 5 seconds and close the application :
[...]
But like this, I don't have all the widgets drawn, I can only see the borders of the frame and the log message.
What's wrong in my code?
First off, you never start wxApp.Mainloop(). Until you do that, no event messages can be processed; some of those event messages are the things that result in your widgets drawing themselves. Second, by using time.sleep(), you're causing this one function to monopolize your processor for those five seconds. Even if the main loop *was* running, it (and the widget's OnPaint handlers) would get no processor time.
Instead of using time.sleep() to delay your shutdown, try using a wxTimer. You can use frame.Enable(False) to disallow user interaction during the five second period.
Jeff Shannon
Technician/Programmer
Credit International