snakeware icon indicating copy to clipboard operation
snakeware copied to clipboard

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

Open Abdur-rahmaanJ opened this issue 5 years ago • 1 comments

Abdur-rahmaanJ avatar Jun 02 '20 18:06 Abdur-rahmaanJ

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.

Turtle1331 avatar Jun 06 '20 11:06 Turtle1331