From: <wsw...@nc...> - 2007-01-23 04:52:20
|
I have not tested it, but I think what would fix your problem is if you added everything that you wanted to clear into a frame, and then just loo= p through the frame and set everything to not visible. I've ran into the same problems that you're facing and I've used this approach to fix it. ( Like with my pipes.py example on the vpython.org website ) > > Could someone please correct (or comment on) the following (rather > minimal) example. It runs without any error messages but there are some > unwanted lines and trying to clear a graph by putting visble=3D0 doesn'= t > work. > > Yours > Poul Riis > > > > from visual.graph import * > from math import * > from time import * > > graph =3D gdisplay(title=3D'Test',width=3D400, > height=3D300,foreground=3Dcolor.black, background=3Dcolor.white) > graphcurve=3D gcurve(color=3Dcolor.red) > > for i in range (0,360): > graphcurve.plot(pos=3D(i,sin(i/180.0*pi))) > sleep(0.005) > > #painting the curve white, thus clearing it: > graphcurve.color=3Dcolor.white > for i in range (0,360): > graphcurve.plot(pos=3D(i,sin(i/180.0*pi))) > sleep(0.005) > > #another curve in blue: > graphcurve.color=3Dcolor.blue > for i in range (0,360): > graphcurve.plot(pos=3D(i,cos(i/180.0*pi))) > sleep(0.005) > > #Hoping to clear the blue curve...: > graphcurve.visible=3D0 > #Redrawing the curve in green: > graphcurve.color=3Dcolor.green > for i in range (0,360): > graphcurve.plot(pos=3D(i,cos(i/180.0*pi))) > sleep(0.005) > > > > ########################################### > Denne meddelelse med evt. vedl=E6g er scannet af SkoleKom ved hj=E6lp = af > F-Secure virusscanner. > > For yderligere information, > http://forside.skolekom.dk/indhold/punkt1/viruspolitik > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV_______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |