winfo_id on OS/X

Jeff Hultquist <[email protected]>
Newsgroups gmane.comp.python.tkinter
Message-ID <[email protected]>
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
[email protected]
https://mail.python.org/mailman/listinfo/tkinter-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.