I am trying to use tkinter with the Panda3D (panda3d.org <http://panda3d.org/>) graphics library. I want to position a graphics window into a tkinter frame.
Attached below is some sample code that uses the frame.winfo_id() as the argument to Panda3Dās setParentWindow method. This works on Linux and Windows, but seg-faults on OS/X. It appears the winfo_id is not valid on OS/X. How can we get a proper handle for the parenting of the 3d view into a tkinter frame? FWIW, there is a thread is ongoing on the Panda3D forum, but the answer seems to lie deep inside tkinter. https://www.panda3d.org/forums/viewtopic.php?f=4&t=18449 <https://www.panda3d.org/forums/viewtopic.php?f=4&t=18449> Many thanks. ---------------------------------- from direct.showbase.ShowBase import ShowBase from panda3d.core import WindowProperties import Tkinter base = ShowBase(windowType='none') base.startTk() frame = base.tkRoot frame.update() id = frame.winfo_id() width = frame.winfo_width() height = frame.winfo_height() props = WindowProperties() props.setParentWindow(id) props.setOrigin(0, 0) props.setSize(width, height) base.makeDefaultPipe() base.openDefaultWindow(props=props) # āā on OS/X, we segfault here scene = base.loader.loadModel("environment") scene.reparentTo(base.render) base.run() ----------------------------------
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss