Here comes one weird situation, and one weird bug(?) report, from a
relative newbie with wxPython.
Basically, if I try to embed .xrc files into .py files (using pywxrc),
and then run the InitXmlResource() method, *only* the first one will
work. All others will fail.
I've tried renaming the method, I've tried trick after trick for finding
and fixing this issue, but I'm not capable (yet) of debugging this
error, as it's generating a segmentation fault.
This has also occurred on two separate platforms.
I've also attached the simplest case I could create which would show
this problem. One source file, two .xrc files. Save them all in the same
directory, and run the commands I've attached. You'll be able to see the
problem occur.
To show that the problem only occurs on the second (and subsequent?)
calls, remove the line from test.py which reads
"test2.InitXmlResource()", and re-run. Everything works just fine.
I need to keep these .xrc files as separate python modules. Without
trying to go into a detail, it's a requirement that these things be
separate.
Anybody have any suggestions for me to ponder?
Thanks for any help you can provide!
···
--
Michael J. Pedersen
My IM IDs: Jabber/pedersen@icelus.tzo.com, ICQ/103345809, AIM/pedermj022171
Yahoo/pedermj2002, MSN/pedermj022171@hotmail.com
My GnuPG KeyID: 4E724A60 My Public Key Available At: pgp.mit.edu
My GnuPG Key Fingerprint: C31C 7E90 5992 9E5E 9A02 233D D8DD 985E 4E72 4A60
--
Versions here:
----------------------
Linux Platform
Linux: Debian testing/unstable
wxPython: 2.6.3.2, built from source, using RPM rebuild instructions
found at http://www.bitpim.org/developer.html
Python: 2.3.5
----------------------
----------------------
Windows Platform
Windows: 2000sp4, all current updates
wxPython: 2.6.2.1, downloaded from wxpython.org/sf.net
Python: 2.4.2
----------------------
Commands Here:
----------------------
pywxrc -p -o test1.py test1.xrc
pywxrc -p -o test2.py test2.xrc
python test.py
----------------------
Source Code Listings Here:
test1.xrc:
----------------------
<?xml version="1.0" encoding="ascii"?>
<resource>
<object class="wxDialog" name="DIALOG1">
<title></title>
<object class="wxButton" name="wxID_OK">
<label>test1</label>
</object>
</object>
</resource>
----------------------
test2.xrc:
----------------------
<?xml version="1.0" encoding="ascii"?>
<resource>
<object class="wxDialog" name="DIALOG2">
<title></title>
<object class="wxButton" name="wxID_OK">
<label>test2</label>
</object>
</object>
</resource>
----------------------
test.py
----------------------
import wx
import wx.xrc
import test1
import test2
class icatest(wx.App):
def OnInit (self):
wx.InitAllImageHandlers()
wx.xrc.XmlResource.Get().InitAllHandlers()
test1.InitXmlResource()
test2.InitXmlResource()
return(True)
def main ():
app = icatest()
app.MainLoop()
if __name__ == '__main__':
__name__ = "Tester"
main()
----------------------