kxgames / glooey

An object-oriented GUI library for pyglet.
MIT License
91 stars 6 forks source link

Arguments to glooey.Gui #34

Closed asteppke closed 4 years ago

asteppke commented 4 years ago

Just getting started with glooey I tripped over this bit in the documentation:

window = pyglet.window.Window()
batch = pyglet.graphics.Batch()
group = pyglet.graphics.Group()
gui = glooey.Gui(window, batch, group)

This leads with the current glooey 0.2.1 to TypeError: __init__() takes 2 positional arguments but 4 were given. The Gui class does not allow for several positional arguments:

def __init__(self, window, *, cursor=None, hotspot=None,
            clear_before_draw=None, batch=None, group=None):

I don't know about the history of this change because the statement in the docs used to work before. Can this just be replaced with gui = glooey.Gui(window, batch=batch, group=group)?

kalekundert commented 4 years ago

Thanks for catching this! Yes, you should be able to just replace that line with gui = glooey.Gui(window, batch=batch, group=group). I'll update the documentation momentarily.

kalekundert commented 4 years ago

Fixed by 5eb44d67