From: leau2001 <lea...@fr...> - 2006-02-10 13:42:24
|
Hi all, I hve a problem with slider. When i used one, the slider value init=0 and why not the mini i chose... ? Program : from visual.controls import * c = controls() # Create controls window def calcul (d,e): #result=int(d/e) print d, e print txt b = slider( pos=(-20,20), width=6, height=20, min=10000, max=100000, action=lambda: calcul(60000,txt)) # Create a slider in the controls window: while 1: c.interact() # Check for mouse events and drive specified actions txt=b.value txt=int(txt) print txt #result=60000/txt #print result When you run this program like this, you see the slider value are on 0... and the when you touch the slider a little, slider value come's to 10000 as the min value. But why this slider value is 0 at the beginning and not the min value ? thx for help lo |
From: Bruce S. <Bru...@nc...> - 2006-02-11 22:09:51
|
Thanks very much for the clear report. It turned out that the controls module never had treated a nonzero minimum correctly. I sent a corrected version of controls.py to Leau. I will of course update VPython to incorporate the corrections. Bruce Sherwood leau2001 wrote: > Hi all, > > I hve a problem with slider. > When i used one, the slider value init=0 and why not the mini i > chose... ? > > Program : > > from visual.controls import * > > c = controls() # Create controls window > > def calcul (d,e): > #result=int(d/e) > print d, e > print txt > > b = slider( pos=(-20,20), width=6, height=20, min=10000, max=100000, > action=lambda: calcul(60000,txt)) # Create a slider in the controls > window: > > > while 1: > c.interact() # Check for mouse events and drive specified > actions > txt=b.value > txt=int(txt) > print txt > #result=60000/txt > #print result > > When you run this program like this, you see the slider value are on > 0... and the when you touch the slider a little, slider value come's > to 10000 as the min value. > But why this slider value is 0 at the beginning and not the min value ? > > thx for help > > lo > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Laney M. <mi...@co...> - 2006-02-12 00:00:10
|
Hi Bruce, Gary has helped me with a couple of Python questions. Since you use VPython a lot, do you know how to adjust the dot size for vpython 2d plots. I want to make the Mandelbrot set, which needs the highest resolution I can get, one pixel per dot if possible. I think the control of dot size is done deep down in some library function called by vpython. I was just hoping you had seen how to make that happen. From within vpython, the minium dot size is much larger than one pixel. Otherwise, vpython is perfect for the job. Thanks, Laney Mills, College of Charleston Bruce Sherwood wrote: > Thanks very much for the clear report. It turned out that the controls > module never had treated a nonzero minimum correctly. I sent a corrected > version of controls.py to Leau. I will of course update VPython to > incorporate the corrections. > > Bruce Sherwood > > leau2001 wrote: > >> Hi all, >> >> I hve a problem with slider. >> When i used one, the slider value init=0 and why not the mini i >> chose... ? >> >> Program : >> >> from visual.controls import * >> >> c = controls() # Create controls window >> >> def calcul (d,e): >> #result=int(d/e) >> print d, e >> print txt >> >> b = slider( pos=(-20,20), width=6, height=20, min=10000, max=100000, >> action=lambda: calcul(60000,txt)) # Create a slider in the controls >> window: >> >> >> while 1: >> c.interact() # Check for mouse events and drive specified >> actions >> txt=b.value >> txt=int(txt) >> print txt >> #result=60000/txt >> #print result >> >> When you run this program like this, you see the slider value are on >> 0... and the when you touch the slider a little, slider value come's >> to 10000 as the min value. >> But why this slider value is 0 at the beginning and not the min value ? >> >> thx for help >> >> lo >> >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. Do you grep through log >> files >> for problems? Stop! Download the new AJAX search engine that makes >> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |