kxgames / glooey

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

Overriding a button's label no longer seems to work #29

Closed EdwardWatine closed 5 years ago

EdwardWatine commented 5 years ago

Downloading the 'stylizing_widgets' tutorial to make sure that I wasn't missing anything, but even the tutorial creates this image Evidently overriding a button's Foreground attribute no longer seems to work. Thanks!

kalekundert commented 5 years ago

Thnks for finding this. I just refactored the Button class a week or two ago, so that must be the cause of the regression.

kalekundert commented 5 years ago

Can you try downloading the most recent version of glooey from Github (or doing pip install --upgrade glooey --- I just uploaded the most recent code to PyPI) and running the tutorial script again? I want to be sure this isn't just some kind of version-mismatch issue.

Some background: In commit 4eacfdc7c, I changed the Button class so that rather than having Label and Image inner classes, it just has a single Foreground inner class. This is more flexible, because the foreground can be any widget (or combination of widgets), while before Label and Image had to be a label and an image, respectively. However, this did break backwards compatibility. So it's important to make sure we're working with the same version.

Also, for me the code in the "Stylizing Widgets" tutorial still seems to work properly. So it might help if you can post the exact code snippets that you're running. If you know which commit of glooey you're using, that would be helpful information, too.

EdwardWatine commented 5 years ago

You're correct, turns out I forgot to --upgrade on the pip install yesterday. I assumed that pip install would upgrade automatically but I guess not (whoops). All is working fine now thank you!