3838 import tkinter
3939 from PIL import ImageTk , Image
4040 from tkinter import Tk
41+ from tkinter .ttk import Button , Label
4142except :
4243 print (
4344 "[ERROR] Tkinter dependency not installed. Please follow troubleshooting page: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Troubleshooting#all-os-tkinter-dependency-not-installed" )
@@ -171,7 +172,7 @@ def __init__(self):
171172 else :
172173 size = self .display_width if self .display_width < self .display_height else self .display_height
173174 self .display_image = ImageTk .PhotoImage (self .ERROR_IN_THEME .resize ((size , size )))
174- self .viewer_picture = tkinter . Label (self , image = self .display_image , borderwidth = 0 )
175+ self .viewer_picture = Label (self , image = self .display_image , borderwidth = 0 )
175176 self .viewer_picture .place (x = self .RGB_LED_MARGIN , y = self .RGB_LED_MARGIN )
176177
177178 # Allow to click on preview to show coordinates and draw zones
@@ -182,20 +183,20 @@ def __init__(self):
182183 # Allow to resize editor using mouse wheel or buttons
183184 self .bind_all ("<MouseWheel>" , self .on_mousewheel )
184185
185- zoom_plus_btn = tkinter . Button (self , text = "Zoom +" , command = lambda : self .on_zoom_plus ())
186+ zoom_plus_btn = Button (self , text = "Zoom +" , command = lambda : self .on_zoom_plus ())
186187 zoom_plus_btn .place (x = self .RGB_LED_MARGIN , y = self .display_height + 2 * self .RGB_LED_MARGIN , height = 30 ,
187188 width = int (self .display_width / 2 ))
188189
189- zoom_minus_btn = tkinter . Button (self , text = "Zoom -" , command = lambda : self .on_zoom_minus ())
190+ zoom_minus_btn = Button (self , text = "Zoom -" , command = lambda : self .on_zoom_minus ())
190191 zoom_minus_btn .place (x = int (self .display_width / 2 ) + self .RGB_LED_MARGIN ,
191192 y = self .display_height + 2 * self .RGB_LED_MARGIN ,
192193 height = 30 , width = int (self .display_width / 2 ))
193194
194- self .label_coord = tkinter . Label (self , text = "Click or draw a zone to show coordinates" )
195+ self .label_coord = Label (self , text = "Click or draw a zone to show coordinates" )
195196 self .label_coord .place (x = 0 , y = self .display_height + 2 * self .RGB_LED_MARGIN + 40 ,
196197 width = self .display_width + 2 * self .RGB_LED_MARGIN )
197198
198- label_info = tkinter . Label (self , text = "This preview will reload when theme file is updated" )
199+ label_info = Label (self , text = "This preview will reload when theme file is updated" )
199200 label_info .place (x = 0 , y = self .display_height + 2 * self .RGB_LED_MARGIN + 60 ,
200201 width = self .display_width + 2 * self .RGB_LED_MARGIN )
201202
0 commit comments