Recently I’ve moved a large app I’ve
been developing to wxPython 3.0.1.1 cocoa 3.0.1.1on OSX, and I’m left
with one pernicious problem: child frames I create will not
be visible. The only way I’ve found to make it appear is to create a
dialog, and when the dialog is created, both the dialog and the child
frame will appear. After a dialog has been closed, subsequent child
frames will appear instantly.
What makes this behavior so pernicious
is that it’s inconsistent. For example, I don’t usually see it on my
main development system (OSX 10.9.5), but if I bundle this with
py2app and run it on another test system (OSX 10.8.6) it happens most
of the time (although the py2app bundle still works fine on the
10.9.5 system, so it doesn’t seem to be related to py2app). I’ve
attached a small demo ffd03.py that demonstrates this problem with
the child frame on the 10.8.6 system. To test this click the “frame” button, and if the child frame does not appear, click the “dialog” button and see them both appear.
On the 10.9.5 system, I can get this
same behavior, where the child frame won’t initially show, if I
create a modal dialog in App.OnInit. And, surprisingly, running this
on the 10.8.6 system cures the problem there (though this opens a
whole new can of worms, and sometimes leads to the program hanging,
as in,
https://groups.google.com/forum/#!topic/wxpython-users/3z0pvPHAGt0 ).
I’ve attached this version as ffd04.py, so if ffd03.py doesn’t show
the problem on your system, maybe ffd04.py will.
In all of these, when the child frame
in not visible, I find that all calls to the child frame methods:
IsShown(), IsShownOnScreen(), IsMaximized(), and IsActive(), all give
the same values as for a frame that is actually visible.
So far I’ve tested this with the
2.9.5.0, 3.0.0.0, and 3.0.1.1 cocoa versions and I see this behavior
with all of them, but I don’t see it with 2.8.12.1 carbon. I haven’t
tried this yet in Windows, but because this seems to be produced at
the osx carbon/cocoa split, I’m guessing it an osx thing.
Any fixes, work-arounds, explanations,
suggestions, or ideas would be greatly appreciated.
Thanks,
Tom
ffd03.py (996 Bytes)
ffd04.py (1.32 KB)