Skip to content

Commit

Permalink
Implement PNG-support check in set_theme_advanced (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedFantom committed Jul 9, 2018
1 parent 86dc1d7 commit 64dcf21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ttkthemes/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ def set_theme_advanced(self, theme_name, brightness=1.0,
Applies the given modifiers to the images of the theme given and
then creates a theme from these new images with the name
'advanced' and then applies this theme.
'advanced' and then applies this theme. Is not available without
support for PNG-based themes, then raises RuntimeError.
"""
if not self.png_support:
raise RuntimeError("PNG-based themes are not supported in the environment")
# Check if the theme is a pixmap theme
if theme_name not in self.pixmap_themes:
raise ValueError("Theme is not a valid pixmap theme")
Expand Down

0 comments on commit 64dcf21

Please sign in to comment.