Theme change causes tcl error #5

Closed
opened 2023-11-21 00:01:58 -03:00 by Snootic · 0 comments
Snootic commented 2023-11-21 00:01:58 -03:00 (Migrated from github.com)

Using theme_use() to change a theme using custom styles for Combox, Spinbox and Separator triggers _tkinter.TclError: Duplicate Element

Error

File "/usr/lib64/python3.11/tkinter/ttk.py", line 438, in element_create self.tk.call(self._name, "element", "create", elementname, etype, _tkinter.TclError: Duplicate element **element(can be TSpinbox.uparrow or TCombobox.downarrow for example)

To reproduce:

In app.py Tela.trocar_tema()

window.style.theme_use(theme)

In app.py Estilo.load_styles()

self.style.configure('custom.TCombobox', font=self.fonte, arrowsize=15) self.style.configure('custom.TSpinbox', font=self.fonte, arrowsize=15)
The error occurs even without setting arrowsize

Most likely a issue with ttkbootstrap. I'm not solving it

Possible workaround:

Make theme changes only effective after restarting the app.

Using theme_use() to change a theme using custom styles for Combox, Spinbox and Separator triggers _tkinter.TclError: Duplicate Element ### Error `File "/usr/lib64/python3.11/tkinter/ttk.py", line 438, in element_create self.tk.call(self._name, "element", "create", elementname, etype, _tkinter.TclError: Duplicate element **element(can be TSpinbox.uparrow or TCombobox.downarrow for example)` ### To reproduce: #### In app.py Tela.trocar_tema() ` window.style.theme_use(theme)` #### In app.py Estilo.load_styles() `self.style.configure('custom.TCombobox', font=self.fonte, arrowsize=15) self.style.configure('custom.TSpinbox', font=self.fonte, arrowsize=15) ` **The error occurs even without setting arrowsize** Most likely a issue with ttkbootstrap. I'm not solving it ### Possible workaround: Make theme changes only effective after restarting the app.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
snootic/applicatas-mutant#5
No description provided.