Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] __init__.py and __pycache__ gets listed in background images list #48

Open
Abdur-rahmaanJ opened this issue Jun 2, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@Abdur-rahmaanJ
Copy link
Contributor

No description provided.

@Turtle1331
Copy link

It looks like pygame_gui.windows.UIFileDialog only distinguishes between files and directories, not between files with different extensions. Luckily, wm.py checks the format in set_bg_image before loading the image, so choosing a non-image file doesn't break anything.

A simple fix would be to move the images to a separate directory. That way, if the user really wants to select __init__.py, (a) they have to do so intentionally and (b) it still has no effect. More extensive changes could include displaying an error and/or reopening the file dialog if the file is not accepted, or perhaps modifying/subclassing UIFileDialog to add a file extension filter.

@joshiemoore joshiemoore added the bug Something isn't working label Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants