Here you go:

#!/usr/bin/env python
# encoding: utf-8

import pyglet
from pyglet.window import key

import Tkinter, tkFileDialog

window = pyglet.window.Window(width=1024, height=768, caption='Dialog
Test')

@window.event
def on_draw():
    window.clear()

@window.event
def on_key_press(symbol, modifiers):
    if symbol == key.O:
        root = Tkinter.Tk()
        root.withdraw()
        filename = tkFileDialog.askopenfilename()
        root.destroy()
        print filename

if __name__ == '__main__':
    pyglet.app.run()






On Nov 30, 8:26 am, Tristam MacDonald <[email protected]> wrote:
> On Mon, Nov 30, 2009 at 11:03 AM, Daniel <[email protected]> wrote:
> > For those that are curious, this appears to be a problem with Snow
> > Leopord (running with the prefer 32bit workaround).  The exact program
> > works fine on another mac using Leopord.  The error occurs when you
> > exit out of a tkinter file dialog either by pressing the OK or Cancel
> > buttons, and only occurs if the pyglet event loop is running (you can
> > put the open dialog code before pyglet.app.run() and it runs fine).
>
> If you are able to put together a minimal sample, I can give it a go on my
> Snow Leopard machines, and see if I can find the conflict.
>
> --
> Tristam MacDonaldhttp://swiftcoder.wordpress.com/

--

You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.


Reply via email to