VPython 7.1.3: new wtext object; fix to attach_arrow

44 views
Skip to first unread message

Bruce Sherwood

unread,
Aug 27, 2017, 10:21:57 PM8/27/17
to VPython-users
Update to VPython 7.1.3. Thanks to Matt Craig for building the installers.

You can get the latest version this way: pip install vpython --upgrade
Or if using Anaconda, conda update -c vpython vpython

The wtext object lets you place in the middle of a canvas title or caption a dynamically modifiable piece of text. In the following example, as you drag the slider the wtext object to the right of the slider shows the current slider value:

from vpython import *
scene.width = scene.height = 200
box()

def f(s):
    wt.text = '{} meters'.format(s.value)

scene.caption = 'Start of the caption.\n\n'
slider(bind=f, length=100, right=15) # right margin = 15 pixels
wt = wtext(text='0 meters')
scene.append_to_caption('\n\nBelow the slider.')

VPython 7.1.3 also fixes the attach_arrow mechannism, which was completely broken.

Bruce

Bruce Sherwood

unread,
Aug 28, 2017, 11:07:17 AM8/28/17
to VPython-users
Here are a couple of the standard GlowScript demo programs now augmented by the use of wtext to display slider values:


These programs will run in VPython 7.1.3.

Bruce

Bruce Sherwood

unread,
Sep 12, 2017, 10:28:05 PM9/12/17
to VPython-users
This is a test, being done because I was notified by email of a new post but that post has not shown up (as yet) in this forum. I want to see whether this note shows up or not.
Reply all
Reply to author
Forward
0 new messages