From: Kevin A. <ka...@us...> - 2004-10-11 02:09:26
|
Update of /cvsroot/pythoncard/PythonCard/samples/flock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18269 Modified Files: flock.py flock.rsrc.py Log Message: minor tweaks for pysco, using refresh, etc. Index: flock.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/flock/flock.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** flock.py 11 Oct 2004 01:56:58 -0000 1.1 --- flock.py 11 Oct 2004 02:09:12 -0000 1.2 *************** *** 15,23 **** from __future__ import division ! from PythonCard import clipboard, dialog, graphic, model, util, timer ! import wx import os import random # helper functions --- 15,30 ---- from __future__ import division ! try: ! import psyco ! psyco.full() ! except: ! pass ! import os + import wx import random + from PythonCard import clipboard, dialog, graphic, model, util, timer + # helper functions *************** *** 181,186 **** self.sprites = [] self.timer = timer.Timer(self.components.btnAnimate, -1) - ## import psyco - ## psyco.full() self.initSizers() self.components.bufOff.autoRefresh = False --- 188,191 ---- *************** *** 212,215 **** --- 217,221 ---- for b in self.sprites: b.draw() + self.components.bufOff.refresh() def on_btnAnimate_mouseClick(self, event): *************** *** 226,230 **** for b in self.sprites: b.move() ! self.components.bufOff.redraw() self.frame += 1 self.seconds = util.time() --- 232,239 ---- for b in self.sprites: b.move() ! # don't need to use redraw() on Mac because ! # we are using a timer and giving the screen ! # a chance to update it itself normally ! self.components.bufOff.refresh() self.frame += 1 self.seconds = util.time() Index: flock.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/flock/flock.rsrc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** flock.rsrc.py 11 Oct 2004 01:56:58 -0000 1.1 --- flock.rsrc.py 11 Oct 2004 02:09:12 -0000 1.2 *************** *** 56,60 **** 'name':'btnNewBoid', 'position':(5, 5), ! 'label':'New Ball' }, { 'type':'Button', 'name':'btnAnimate', --- 56,60 ---- 'name':'btnNewBoid', 'position':(5, 5), ! 'label':'New Boid' }, { 'type':'Button', 'name':'btnAnimate', |