RSS

Wxpython and XRC

I dug up some old code and have been converting a wxPython program to use XRC resources. I like the separation, between the layout and the code, but there are a bunch of things I don’t like. The error messages are often cryptic. For instance, “‘Nonetype’ object has no attribute ‘FindWindowById’” could mean that you are missing an or tag in your XRC file. However, the error doesn’t say you are missing an object tag; it goes off about some sort of non-existent attribute. No handler found for XML node ‘object’, class ‘xxx’!” probably means you missed putting a sizer object around a child in one of the different sizer container controls. I suppose this is where an IDE would be useful to do refcounting of object/object and to determine if children inside a sizer control are suitably wrapped. I generally prefer to write everything using Vim. I’m not sure I’m smart enough to write a vim mode that could handle XRC files, but I can see where one would be pretty useful. Another “issue” I have is that most of the examples of using wxPython are not using XRC. I sometimes have trouble adapting code I find online to fit in to my model. In the end, though, I’ve been pretty happy with my experiments.

Leave a Reply