On Wednesday 19 May 2004 20:50, Mark Saward wrote: > Hi, > > I'm just starting to learn python and PyQt at the same time.
Good choice. > I'm making > an application using designer. The problem is, that every time I use > 'pyuic' I'm finding I need to modify the resulting file every time. > Right now I need to add a member function: > > def keyPressEvent(self, event): > if event.text() == 'd': > player.Player.x +=1 > > Is there a way I can write that member function in another file and have > it easily accessed by the resulting file from pyuic without needing to > re-add much code every time? Create a new file containing a new class, with the pyuic-generated class as a base class. Add your method to this new class. To use it, create instances of the new class. Dont directly create instances of the pyuic-generated class. I hope that helps. -- Toby Dickenson _______________________________________________ PyKDE mailing list [EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde