vPython display inside window not displaying properly

529 views
Skip to first unread message

Matthijs

unread,
Oct 17, 2013, 12:41:29 PM10/17/13
to vpytho...@googlegroups.com
I seem to have a problem with too large vPython displays inside wxPython windows. Only the height seems to matter, which seems rather odd... You can try it out yourself with this little program. With a height of 500, the display always pops up, but the chances of it popping up decrease when the height is increased. There's just an empty window visible. However, the scene is working, even when it is not displaying. You can guess where the scene should be and drag the view around, only nothing is visible. Can anyone help me out?

from visual import *


#Creating window

w = window(title='wxPython display size')

w.win.Maximize()


#Setting up scene and drawing ball

display(window=w, height=600, width=400)

ball = sphere()


Bruce Sherwood

unread,
Oct 17, 2013, 1:23:46 PM10/17/13
to vpytho...@googlegroups.com
I discovered that this very simple program works properly:

w = window(menus=True)
display(window=w)
ball = sphere()

Change to menus=False (which is the default) and the program displays incorrectly on Windows and Ubuntu until and unless you resize the window. There is no problem on a Mac, where menus don't yet work at all.

I've filed this issue on our GitHub site. Thanks much for the informative, simple test program.

Matthijs

unread,
Oct 17, 2013, 2:19:25 PM10/17/13
to vpytho...@googlegroups.com
But adding menus=True to my program still doesn't make the display appear with a height above 500... So something else is wrong too. And yes, your tiny program only works with menus=True.

Bruce Sherwood

unread,
Oct 17, 2013, 3:58:18 PM10/17/13
to vpytho...@googlegroups.com
What operating system are you using? Is your graphics driver up to date? I can't make your program fail with display height > 500 and window menus=True on Windows, Mac, or Ubuntu 12.04.

Matthijs

unread,
Oct 17, 2013, 5:17:48 PM10/17/13
to vpytho...@googlegroups.com
Windows 8, and yes, all my drivers are up to date. Since I'm running this program on a laptop that has two graphic cards (GT650M and Intel HD4000), I checked to see if it happens on both cards and yes it does. I have attached my complete program, it's about the motion of a cue ball with a given rotation and velocity. Under ''Setting up scene", you can adjust the height of the display.
ball_animation_gui.py

Matthijs

unread,
Oct 17, 2013, 5:20:43 PM10/17/13
to vpytho...@googlegroups.com
And oh, I'm running 64-bit Python as well as 64-bit vPython.

Bruce Sherwood

unread,
Oct 17, 2013, 7:54:08 PM10/17/13
to vpytho...@googlegroups.com
Well, unfortunately I've used up my resources. It would be somewhat surprising to learn that it is a Windows 8 problem, but in any case let's hope that someone else who reads this forum can reproduce the problem on some platform or other, to give us more data.

Bruce Sherwood

unread,
Oct 17, 2013, 7:58:32 PM10/17/13
to vpytho...@googlegroups.com
I spoke too soon. At least on Windows, running your full program fails unless I comment out w.win.Maximize(), so maybe I do have something to chew on after all.

Bruce Sherwood

unread,
Oct 17, 2013, 8:24:55 PM10/17/13
to vpytho...@googlegroups.com
The following program running (at least) on 64-bit Windows 7 (with 64-bit VPython) fails or succeeds depending on the values I choose for window width and height. It shows among other things that maximizing the window isn't the fundamental problem, rather it does indeed have to do with choosing large values for width and/or height (I didn't map out the full range of success and failure).

from visual import *
# On Windows 7 with 64-bit VPython and screen that is 2498 wide, 1558 high
w_width = 1800 # works with 1800, fails with 1900
w_height = 1500
w = window(menus=True, width=w_width, height=w_height)
display(window=w, width=w_width-100, height=w_height-150)
sphere()

Matthijs

unread,
Oct 18, 2013, 12:40:44 PM10/18/13
to vpytho...@googlegroups.com
This post on stackoverflow seems to indicate the same problem.

http://stackoverflow.com/questions/18717132/program-in-wxpython-and-vpython

Bruce Sherwood

unread,
Oct 18, 2013, 5:29:23 PM10/18/13
to vpytho...@googlegroups.com
I suspect it's a different problem, because your problem is reproducible -- same (bad) behavior every time one uses a large height, whereas the problem reported in stackoverflow is intermittent.
Reply all
Reply to author
Forward
0 new messages