I'm getting some really strange behavior with a wxpython app I'm working on. When I run the application directly (e.g. python ./main.py), everything works fine. However, when I run the packaged version of the app (made with py2app), I get some odd behavior.
Specifically: I have a checkbox that, when checked, opens a wx.Frame. When running the application directly it works fine. When I'm using the packaged version, nothing happens on the first click of the checkbox. To get the window to show up, I have to uncheck the checkbox and then re-check it. The click event does get fired off, and frame.show() gets called, but the window never shows up on the first click.
Here's the py2app config code:
from setuptools import setup
APP = ['MessengerVisualization.py']
DATA_FILES = ['UVVSSCIC.FMT', 'data', 'magfield', 'shaders', 'textures', 'features.csv', 'libspice.dylib', 'Na.M2.PSD.fast.stick.density.dat', 'messenger_kernels']
OPTIONS = {'argv_emulation': False}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app']
)
Here's an abbreviated version of the code that show()s the window:
def handler(evt):
if cb.GetValue():
frame = UVVSFrame(None, -1, 'MASCS UVVS Data: %s (%s)' % (species,typestr),
size=(854, 480), controller=self, view=view_b,
data_provider=self.uvvs_provider,
shader_style=style)
frame.identifier = wx.NewId()
frame.Bind(wx.EVT_CLOSE, frame_cleanup(frame.identifier))
frame.Show()
It looks like other people have had problems with argv_emulation, but setting it to False didn't seem to fix my problems.
I also tried doing frame.show(), frame.hide(), frame.show() when catching the event (in case something was preventing the first show()), but that didn't help.
Any ideas? Thanks in advance!