kxgames / glooey

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

LineClock.py example does not initialize properly #14

Closed acubas closed 6 years ago

acubas commented 6 years ago

I was looking through the 'Making widgets from scraps' page and I decided to test out the LineClock example (here) for using OpenGL with glooey by running it. It seems that it does not run properly as it is. The error comes from initializing an instance of the LineClock class because it tries to create Rectangle without a batch defined. I hard coded the the batch in the contructor of LineClock. It seems to have fixed that.

Also, I found that your color here raised an error because it has not attribute rgb.

color = glooey.drawing.Color.from_anything(self._color) 
colors = num_vertices * color.rgb

I replaced color.rgb with color.tuple[:3] which seems to work.

However, I haven't been able to figure out the latest error. It indicates that the Rectangle class does not have a show method because you used it in line 140. I can't find any signs of a show method in the artists file. Am I missing something? or was it forgotten?

P.S.: Great project!

kalekundert commented 6 years ago

Sorry to make you dig through the source trying to get a demo to work. I think these bugs are due to discrepencies between the most recent version of the code and the 0.1.1 release (show() used to be called unhide(), to answer your specific question). I just made a 0.1.2 release last night, so can you try pip install --upgrade glooey and see if that works?

acubas commented 6 years ago

Oh, how silly of me. Yep, it runs. I should have been mindful of your releases. Thank you for the quick reply.