Open HawKen147 opened 4 months ago
Hello,
I needed to change the locale variable to get the french format days, but i get a "bad screen distance "250.0"". This error happen when i try to open or create a new window. I use this code from the Documentation :
import locale import customtkinter class MyFrame(customtkinter.CTkFrame): def __init__(self, master, **kwargs): super().__init__(master, **kwargs) # add widgets onto the frame, for example: self.label = customtkinter.CTkLabel(self) self.label.grid(row=0, column=0, padx=20) class App(customtkinter.CTk): def __init__(self): super().__init__() self.geometry("400x200") self.grid_rowconfigure(0, weight=1) # configure grid system self.grid_columnconfigure(0, weight=1) self.my_frame = MyFrame(master=self) self.my_frame.grid(row=0, column=0, padx=20, pady=20, sticky="nsew") app = App() app.mainloop()
But when i try to change the language with the locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') before creating the window, it doesn't work anymore
locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
import locale import customtkinter locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') class MyFrame(customtkinter.CTkFrame): def __init__(self, master, **kwargs): super().__init__(master, **kwargs) # add widgets onto the frame, for example: self.label = customtkinter.CTkLabel(self) self.label.grid(row=0, column=0, padx=20) class App(customtkinter.CTk): def __init__(self): super().__init__() self.geometry("400x200") self.grid_rowconfigure(0, weight=1) # configure grid system self.grid_columnconfigure(0, weight=1) self.my_frame = MyFrame(master=self) self.my_frame.grid(row=0, column=0, padx=20, pady=20, sticky="nsew") app = App() app.mainloop()
i don't really know why it doesn't work and how i can by pass it
Hello,
I needed to change the locale variable to get the french format days, but i get a "bad screen distance "250.0"". This error happen when i try to open or create a new window. I use this code from the Documentation :
But when i try to change the language with the
locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
before creating the window, it doesn't work anymorei don't really know why it doesn't work and how i can by pass it