Question

Every time I start this application two windows appear. I don't really see the problem there:

class GUI(pyglet.window.Window):
def __init__(self):
    super(GUI, self).__init__()
    self.initUI()

def initUI(self):
    self.window = pyglet.window.Window()


@window.event
def on_draw(self):
    self.window.clear()
    pyglet.graphics.draw(2, pyglet.gl.GL_POINTS,('v2i',(10,15, 50, 50)))
Was it helpful?

Solution

When you call the super's constructor, it's making it's own window (see here). Then you make a second in initUI

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top