0
opengl 위젯을 추가하려는 기존 tkinter GUI가 있습니다. 그러나 OpenGL 위젯은 최상위 레벨 인 경우에만 작동합니다.tkinter의 최상위 OpenGL 위젯
from OpenGL.Tk import *
from Tkinter import *
herp=Opengl(height=100,width=100)
herp.pack()
herp.mainloop()
을하지만이되지 않습니다 :
이 작동
Traceback (most recent call last):
File "\\sith\user_files\2013-Softerns\new_gui_planning\LearningOpenGL\integration_3.py", line 4, in <module>
b=Opengl(root,height=100,width=100)
File "C:\Python27_32bit\lib\site-packages\OpenGL\Tk\__init__.py", line 267, in __init__
apply(RawOpengl.__init__, (self, master, cnf), kw)
File "C:\Python27_32bit\lib\site-packages\OpenGL\Tk\__init__.py", line 216, in __init__
Widget.__init__(self, master, 'togl', cnf, kw)
File "C:\Python27_32bit\lib\lib-tk\Tkinter.py", line 2036, in __init__
(widgetName, self._w) + extra + self._options(cnf))
TclError: invalid command name "togl"
내가 togl를 가져올해야합니까 :
from OpenGL.Tk import *
root=Tk()
b=Opengl(root,height=100,width=100)
b.pack()
root.mainloop()
나에게 다음과 같은 오류주기?
http://computer-programming-forum.com/56-python/ece79da9298c54de.htm
그러나 그들의 솔루션은 나를 위해 작동하지 않습니다 :이에서 찾을 수
유일한 다른 것입니다.
망각, 당신의 솔루션은 완벽하게 작동합니다! 동일한 상황에있는 사람들을 위해 나중에 코드에서 OpenGL 위젯을 사용해야하는 경우 루트를 추출한 다음 나중에 OpenGL 위젯을 다시 정의 할 수 있습니다. 매력처럼 작동합니다. – code11