mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
replaced sys.stderr with warnings.warn #932
This commit is contained in:
parent
8a537076ce
commit
a79502dc03
@ -1,4 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
import tkinter
|
import tkinter
|
||||||
import tkinter.ttk as ttk
|
import tkinter.ttk as ttk
|
||||||
from typing import Union, Callable, Tuple
|
from typing import Union, Callable, Tuple
|
||||||
@ -158,7 +159,7 @@ class CTkBaseClass(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBaseClas
|
|||||||
return font
|
return font
|
||||||
|
|
||||||
elif type(font) == tuple and len(font) == 1:
|
elif type(font) == tuple and len(font) == 1:
|
||||||
sys.stderr.write(f"{type(self).__name__} Warning: font {font} given without size, will be extended with default text size of current theme\n")
|
warnings.warn(f"{type(self).__name__} Warning: font {font} given without size, will be extended with default text size of current theme\n")
|
||||||
return font[0], ThemeManager.theme["text"]["size"]
|
return font[0], ThemeManager.theme["text"]["size"]
|
||||||
|
|
||||||
elif type(font) == tuple and 2 <= len(font) <= 6:
|
elif type(font) == tuple and 2 <= len(font) <= 6:
|
||||||
@ -178,7 +179,7 @@ class CTkBaseClass(tkinter.Frame, CTkAppearanceModeBaseClass, CTkScalingBaseClas
|
|||||||
elif isinstance(image, CTkImage):
|
elif isinstance(image, CTkImage):
|
||||||
return image
|
return image
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(f"{type(self).__name__} Warning: Given image is not CTkImage but {type(image)}. " +
|
warnings.warn(f"{type(self).__name__} Warning: Given image is not CTkImage but {type(image)}. " +
|
||||||
f"Image can not be scaled on HighDPI displays, use CTkImage instead.\n")
|
f"Image can not be scaled on HighDPI displays, use CTkImage instead.\n")
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user