Hi Benjamin,

Yes, I meant Pyglet 1.2.4 ;)

I tried changing "Figure()" for "figX = Figure()" and that didn't work. Yes, 
that's a bit embarrassing.

Thanks,

--
  Hugo Gagnon

On Wed, Jul 5, 2017, at 21:07, Benjamin Moran wrote:
> Hi Hugo, 
> 
> Are you sure you don't mean pyglet v1.2.4? :)
> I tried this on my Linux machine, and both cases worked perfectly (python2 
> and 3, pyglet 1.2.4).
> Maybe it's something simple, like the Window instances being garbage 
> collected.
> Does this have any effect? 
> 
> fig1 = Figure()
> fig2 = Figure()
> 
> 
> 
> 
> 
> 
> On Thursday, July 6, 2017 at 1:55:49 AM UTC+9, Hugo Gagnon wrote:
> >
> > Hi,
> >
> > The following snippet works fine:
> >
> > import pyglet
> >> class Figure(pyglet.window.Window): 
> >
> >     ID = 0
> >>     def __init__(self):
> >>         Figure.ID += 1
> >>         super(Figure, self).__init__(caption='fig' + str(Figure.ID))
> >>         self.fps = pyglet.clock.ClockDisplay()
> >>     def on_draw(self):
> >>         self.clear()
> >>         self.fps.draw()
> >> Figure()
> >> Figure()
> >> pyglet.app.run()
> >
> >
> > However, if I replace "pyglet.app.run()" with my own event loop:
> >
> > while True:
> >>     pyglet.clock.tick()
> >>     for window in pyglet.app.windows:
> >>         window.switch_to()
> >>         window.dispatch_events()
> >>         window.dispatch_event('on_draw')
> >>         window.flip()
> >
> >
> > then the application hangs (before you ask: I need to use my own event 
> > loop for my own application).
> >
> > I use Anaconda Python 2.7 with Pyglet 1.2.7 on Windows 7.
> >
> > Input appreciated!
> >
> > Hugo
> >
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "pyglet-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/pyglet-users.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to