سؤال

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)))
هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top