Stock dialogs not displaying on OSX with wx 3.0.0.0

On python 2.7 with wxPython 3.0.0.0 on Mac OSX 10.9.2 (Mavericks), if a dialog is
displayed from with the OnInit method of wx.App, then subsequent stock dialogs
such as Find/Replace don’t show up on screen until the python icon in the dock is
clicked. The same code doesn’t have this behaviour on Windows with python 2.7
and wx 3.0.0.0 and nor does it occur with previous versions of wxPython on the Mac.

Code example attached. The real example is an editor which encrypts/decrypts files.
When run from the command line with a file name I need to ask for a password so
I can decrypt the file. Is OnInit the right place to do this?

example.py (4.02 KB)

Don Taylor wrote:

On python 2.7 with wxPython 3.0.0.0 on Mac OSX 10.9.2 (Mavericks), if a
dialog is
displayed from with the OnInit method of wx.App, then subsequent stock
dialogs
such as Find/Replace don't show up on screen until the python icon in
the dock is
clicked. The same code doesn't have this behaviour on Windows with
python 2.7
and wx 3.0.0.0 and nor does it occur with previous versions of wxPython
on the Mac.

Code example attached. The real example is an editor which
encrypts/decrypts files.
When run from the command line with a file name I need to ask for a
password so
I can decrypt the file. Is OnInit the right place to do this?

I'm not sure what's going on there, it's definitely weird. I'll poke around and see if I can find anything, but in the meantime you could probably take care of it by showing the dialog after the main loop has started instead of before. For example you could do something like this:

         if self.cmd:
             wx.CallLater(250, self.frame.showLogin)

···

--
Robin Dunn
Software Craftsman

That solves the problem. I didn’t know about CallLater() and hadn’t thought to use the Timer class.
Thanks!

Don

···

On Wednesday, 26 March 2014 15:10:50 UTC+11, Robin Dunn wrote:

I’m not sure what’s going on there, it’s definitely weird. I’ll poke
around and see if I can find anything, but in the meantime you could
probably take care of it by showing the dialog after the main loop has
started instead of before. For example you could do something like this:

     if self.cmd:

         wx.CallLater(250, self.frame.showLogin)


Robin Dunn

Software Craftsman

http://wxPython.org