On Sun, Nov 28, 2010 at 12:47 AM, Robin Dunn <robin@alldunn.com > <mailto:robin@alldunn.com>> wrote:
On 11/27/10 1:28 PM, cool-RR wrote:
On Sat, Nov 27, 2010 at 11:04 PM, cool-RR <cool-rr@cool-rr.com > <mailto:cool-rr@cool-rr.com> > <mailto:cool-rr@cool-rr.com>> wrote:
On Sat, Nov 27, 2010 at 10:34 PM, Robin Dunn > <robin@alldunn.com <mailto:robin@alldunn.com> > <mailto:robin@alldunn.com>> wrote:
On 11/27/10 4:51 AM, cool-RR wrote:
Hello,
On Mac (Leopard) when I try to open either a "save
file" or
a "load
file" dialog in my wxPython app, the app freezes for
about a
minute
and then exits saying "Segmentation fault". On Linux and
Windows these
dialogs work perfectly, but on Mac they give the
segfault.
Here's the line that should show the open dialog:
https://github.com/cool-RR/GarlicSim/blob/shit_goes_in_state/garlicsim_wx/garlicsim_wx/frame/frame.py#L578
And here's the line that should show the save dialog:
https://github.com/cool-RR/GarlicSim/blob/shit_goes_in_state/garlicsim_wx/garlicsim_wx/frame/frame.py#L638
Is anyone familiar with this problem? I'm not a C
programmer
so I have
no clue what to do about this.
What version of wxPython? Does the demo also have this
problem?
When you get the error report info what are the top
few lines
of the stack trace?
--
Robin Dunn
wxPython version: 2.8.10.1.
Demo: I will try soon.
Here are all the details that Mac OS shows: (I'm not sure if
this is
a stack trace.)
Thread 0 Crashed:
0 libwx_macu-2.8.0.dylib 0x01af16e6
wxArrayString::Add(wxString const&, unsigned long) + 182
Hmm... Looks like with the debug info we're not going to get any
helpful information from that.
Tried it on the demo now: In the demo `FileDialog` *does* work
without
issue.
Well, that's a good clue. See if you can figure out what you are
doing differently and that may lead to a fix.
Robin Dunn
I figured it out: The problem is with the wildcard text. This is the
wildcard text I was using:
'GarlicSim Simulation Pickle (*.gssp)|*.gssp|All files (*)|*|'
The problem is that I was putting a `|` at the end of the string, when
it should just be a separator between adjacent file types. Windows and
Linux have no problem with this, but on Mac it causes a segfault.
So now I fixed to this:
'GarlicSim Simulation Pickle (*.gssp)|*.gssp|All files (*)|*'
And everything's working.
It would be nice to have some `assert` in the `FileDialog` code that
will alert the programmer if a bad wildcard is used.