I've been working on getting wxMozilla working with wxPythonOSX and I've run into a problem that I can't seem to figure out on my own here. For some reason, the EVT_MOZILLA_* event functions are not being recognized. Here's what I've done to the original mozilla.i file to make it work with 2.5:
1. Changed the imports to simply %import core.i and do that wx = core namespace thing, like in the other .i files.
2. Created the _mozilla_rename.i file and ran build_renamers.py on it.
3. Converted the event code to use wx.PyEventBinder, like so:
EVT_MOZILLA_URL_CHANGED = wx.PyEventBinder(wxEVT_MOZILLA_URL_CHANGED, 1)
Which to my eyes mimics the syntax seen in other files like stc.i.
Despite all this, as well as my encouraging chants of "come on computer, I know you can do it!", all I get are errors stating:
"NameError: global name 'EVT_MOZILLA_URL_CHANGED' is not defined".
The good news is that if I comment out the event handlers, it runs just fine. =) So this is the last hurdle to getting a fully working wxPyMozilla on OS X. Is there something painfully obvious I've missed here? I'd like to avoid using the Bind syntax, for the demos particularly, because I would like them to work with 2.4 as well.
I've been working on getting wxMozilla working with wxPythonOSX and I've run into a problem that I can't seem to figure out on my own here. For some reason, the EVT_MOZILLA_* event functions are not being recognized. Here's what I've done to the original mozilla.i file to make it work with 2.5:
1. Changed the imports to simply %import core.i and do that wx = core namespace thing, like in the other .i files.
2. Created the _mozilla_rename.i file and ran build_renamers.py on it.
3. Converted the event code to use wx.PyEventBinder, like so:
EVT_MOZILLA_URL_CHANGED = wx.PyEventBinder(wxEVT_MOZILLA_URL_CHANGED, 1)
You've probably done this too, but just to be complete:
4. Changed setup.py to build an extension named _mozilla instead of mozillac.
Which to my eyes mimics the syntax seen in other files like stc.i.
Despite all this, as well as my encouraging chants of "come on computer, I know you can do it!", all I get are errors stating:
"NameError: global name 'EVT_MOZILLA_URL_CHANGED' is not defined".
Are you sure that the wrapper code in #3 is being executed and not some old version or something?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I've been working on getting wxMozilla working with wxPythonOSX and I've run into a problem that I can't seem to figure out on my own here. For some reason, the EVT_MOZILLA_* event functions are not being recognized. Here's what I've done to the original mozilla.i file to make it work with 2.5:
1. Changed the imports to simply %import core.i and do that wx = core namespace thing, like in the other .i files.
2. Created the _mozilla_rename.i file and ran build_renamers.py on it.
3. Converted the event code to use wx.PyEventBinder, like so:
EVT_MOZILLA_URL_CHANGED = wx.PyEventBinder(wxEVT_MOZILLA_URL_CHANGED, 1)
You've probably done this too, but just to be complete:
4. Changed setup.py to build an extension named _mozilla instead of mozillac.
Yeah, I did do this as well.
Which to my eyes mimics the syntax seen in other files like stc.i.
Despite all this, as well as my encouraging chants of "come on computer, I know you can do it!", all I get are errors stating:
"NameError: global name 'EVT_MOZILLA_URL_CHANGED' is not defined".
Are you sure that the wrapper code in #3 is being executed and not some old version or something?
I do know that it is being run, as that file was giving me errors until I renamed "mozillac" to "_mozilla". =)
Actually, looking over it again I found in the stc contrib lib a _stc_reverse.txt and when I copied that file into contrib/mozilla and renamed it _mozilla_reverse.txt, it created some funky code at the bottom of /wxPython/mozilla.py that did some magic renaming of globals apparently, and now the events no longer give me name not found errors. They are also not firing, however, so I'll have to look into that some more... Almost there... =)
Actually, looking over it again I found in the stc contrib lib a _stc_reverse.txt and when I copied that file into contrib/mozilla and renamed it _mozilla_reverse.txt, it created some funky code at the bottom of /wxPython/mozilla.py that did some magic renaming of globals apparently, and now the events no longer give me name not found errors. They are also not firing, however, so I'll have to look into that some more... Almost there... =)
Oh yeah, forgot about that one. That file is for specifying any toplevel things that should show up in the reverse renamer module for the old namespace, but that build_renamers.py is not able to figure out automatically. For example, anything in %pythoncode directives. You can specify full names and they will have the wx prefix added on, or you can give a prefix and a * and it will generate the code you saw to scan and import all symbols with that prefix.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!