wxDialog won't subclass under

Problem solved, nevermind.

It appears that the latest wxPython doesn't like it
when you specify "module.class" in the XRC subclass
definition if you try to load the window from within
module "module".

i.e. I was trying to load the dialog from within the
Firmware module, so the Firmware.DownloadDialog
subclass confused XRC. Had I changed the subclass to
DownloadDialog or tried to load the dialog from my
main program file (which I'm doing now), then it seems
to be okay.

Sorry to waste your bandwidth,

Gre7g

···

--- Gre7g Luterman <hafeliel@yahoo.com> wrote:

I just upgraded from wxPython 2.6.3.3 to 2.8.4.0
(Windows XP and Python 2.4) and the upgrade has
broken
the program I've been working on somehow.

Specifically, I use XRC to load a variety of window
definitions; most of the top-level constructs
(panels,
dialogs, and frames) are subclassed in my code.
However, in this new version of wxPython, when I try
to run my program, I get a dialog that pops up
saying:

Subclass 'Firmware.DownloadDialog' not found for
resource 'DOWNLOAD_DIALOG', not subclassing!

Firmware.DownloadDialog does exist and it is
unchanged
from back when I was using 2.6.3.3:

>>> import Firmware
>>> Firmware.DownloadDialog
<class 'Firmware.DownloadDialog'>

Other subclassed dialogs in the program continue to
work, so the problem isn't with dialogs in general;
it's just this one.

Okay, so I've made an error in this dialog code that
didn't upset the old wxPython and it does upset the
new. I'm cool with that. I've had that sort of
problem in the past. However, this is the only
error
I'm seeing. There's no text in the console to give
me
a hint as to why XRC is unhappy.

Can anyone suggest a way to tell more about the
problem? Or perhaps a plan of attack for figuring
out
why XRC is unhappy?

Gre7g

____________________________________________________________________________________

Pinpoint customers who are looking for what you
sell.
http://searchmarketing.yahoo.com/

      ____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/

Gre7g Luterman wrote:

Problem solved, nevermind.

It appears that the latest wxPython doesn't like it
when you specify "module.class" in the XRC subclass
definition if you try to load the window from within
module "module".

i.e. I was trying to load the dialog from within the
Firmware module, so the Firmware.DownloadDialog
subclass confused XRC. Had I changed the subclass to
DownloadDialog or tried to load the dialog from my
main program file (which I'm doing now), then it seems
to be okay.

The XmlSubclassFactory_Python class does do an import of the specified module, so it can cause problems in certain situations. For example if the module is already in the process of being imported and hasn't yet reached the class you are looking for then it won't be in the module's namespace yet. Or if you run the module as the main script then it won't be in the Python modules list as 'Firmware' but as '__main__' and so you end up importing it twice.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Gotcha! That makes sense.

Ya'know, I think it would be a great help if XRC
dumped a call stack when it encountered a problem
instead of a dialog. I've only had a few problems
with XRC to date, but in almost every circumstance, my
debugging is complicated by XRC telling that there is
a problem, but hiding the "where".

Gre7g

···

--- Robin Dunn <robin@alldunn.com> wrote:

The XmlSubclassFactory_Python class does do an
import of the specified
module, so it can cause problems in certain
situations. For example if
the module is already in the process of being
imported and hasn't yet
reached the class you are looking for then it won't
be in the module's
namespace yet. Or if you run the module as the main
script then it
won't be in the Python modules list as 'Firmware'
but as '__main__' and
so you end up importing it twice.

____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html