Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#35 Customisation through subclasses

open
nobody
None
5
2012-10-24
2008-06-03
No

I don't like editing generated code if I can avoid it!

So I'd hoped to have wxGlade generate classes, but be able to specify a sub-class for instantiation - which I would write myself, importing it through 'extracode'.

That way the generated event methods would be abstract templates, overridden in the hand-written sub-class.

As stands, I can set the base class, name the generated class, but can't set the instantiated class to be a sub-class. So to get my event methods to run, I create a custom base class, generate the code, and delete the template event methods by hand so they no longer mask the real ones.

A related problem: My 'main' script calls the generated GUI. But I can only pass data to it through global variables. I know I'm being fussy, globals do the job just fine, and I'm never likely to instantiate two app instancess ... but globals are ugly!

Discussion