pyglet and tkinter

352 views
Skip to first unread message

Andreas Grätz

unread,
Jun 21, 2012, 7:28:57 AM6/21/12
to pyglet...@googlegroups.com
Hello,

is it possible to use pyglet as an canvas in tkinter? 

Has anyone an example?

Best regards

Andreas

Richard Jones

unread,
Jun 21, 2012, 8:27:33 AM6/21/12
to pyglet...@googlegroups.com
On 21 June 2012 21:28, Andreas Grätz <andre...@googlemail.com> wrote:
> is it possible to use pyglet as an canvas in tkinter?

Tkinter doesn't provide an OpenGL context natively. You can get one by
using the TOGL wrapper in PyOpenGL, and once you have an OpenGL
context you can, in theory, use pyglet. Not sure of the details though
I'm afraid :-)


> Has anyone an example?

I'm not aware of any.


Richard

walgri

unread,
Jun 22, 2012, 2:13:55 AM6/22/12
to pyglet...@googlegroups.com


On Thursday, June 21, 2012 1:28:57 PM UTC+2, Andreas Grätz wrote:
Hello,

is it possible to use pyglet as an canvas in tkinter? 

Hi, I got it working years ago, here's a slightly modified version of togl.py, renamed toglwidget.py, and a couple of demos. You will need to drop togl17.dll and pkgIndex.tcl in your pythonXX\tcl directory. I've just run it in my XP 64 box and works fine.

Sorry for the comments in italian, it was really not meant to be published and I just unburied it from a very old backup.

What I would really love is to drop the dependency from toglXX.dll, which, at version 2.0 (see Sourceforge), is abandoned, again. Can't an Opengl context be created from a tkinter widget hwnd ? I definitely have not the expertise to judge if it is possible witch ctypes or how difficult it can be.


toglwidget.py
demo2.py
demo.py
first.py
Reply all
Reply to author
Forward
0 new messages