also, creating a new label on each update is expensive.
its better to create the label on __init__ and just update the label's
text on each update.

thomas

On 21 dez, 16:04, Silentpolygon <[email protected]> wrote:
> Hello everybody,
>
> I have a strange experience made with this code:
>
> import pyglet
> import time
>
> class ClockWindow(pyglet.window.Window):
>     def __init__(self):
>         super(ClockWindow, self).__init__()
>
>     def on_draw(self):
>         self.clear()
>         self.label = pyglet.text.Label(str(time.time()))
>         self.label.draw()
>
> window = ClockWindow()
> pyglet.app.run()
>
> The 'clock' is only running when i press a key and hold it. Is there
> somerthing wrong with the on_draw function? because normaly it should
> update the buffer on every frame automatically.
--~--~---------~--~----~------------~-------~--~----~
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