PyOpenGL (OpenGL.Tk) conflicts with Tkinter (main program)

Ivan Kozik ivan at xpeNOSPAMnguin.com
Fri Jul 12 15:48:19 EDT 2002


Hello,

I'm having problems using a PyOpenGL canvas inside an existing program.
The OpenGL canvas is not supposed to be run at startup, but is supposed to be
executed by a button. Here is the GL portion of the code:

<the main program is here that imports "Tkinter" and has a button to start
3D_Plot>

from OpenGL.GL import *
from OpenGL.Tk import *
from OpenGL.GLUT import *

class 3D_Plot:

	def __init__(self, rc, list_of_objects, dict_of_objects, \
			annot_D, annot_R, annot_G, annot_B):

		print "Message from class 3D Plot"
		print dict_of_objects


It doesn't matter that it doesn't do anything yet, because when I start
the program, the main program window AND a second canvas shows up. The
second canvas has the title of "tk" and freezes the rest of the program.
How would I make it completely independent? None of the examples show how
to put it in an exisiting program.

Any help would be greatly appreciated.

Thanks,
Ivan



More information about the Python-list mailing list