[ Bug] sg.ColorChooserButton Unless Additional Tkinter Import #6742
Labels
Bug
Something's not right
Done - Install Dev Build (see docs for how)
See https://docs.pysimplegui.com/en/latest/documentation/installing_licensing/upgrading/
Port - TK
PySimpleGUI
Type of Issue (Enhancement, Error, Bug, Question)
Error/Bug
Operating System
Windows 11
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions
Python version: 3.10.11
Platform: Windows
Platform version: ('10', '10.0.22621', 'SP0', 'Multiprocessor Free')
Port: PySimpleGUI
tkinter version: 8.6.12
PySimpleGUI version: 5.0.4
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
sg.ColorChooserButton raises an Exception
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\lukeb\AppData\Local\Programs\Python\Python310\lib\tkinter_init_.py", line 1921, in call
return self.func(*args)
File "C:\Users\lukeb\AppData\Local\Programs\Python\Python310\lib\site-packages\PySimpleGUI\PySimpleGUI.py", line 5016, in ButtonCallBack
color = tk.colorchooser.askcolor(parent=self.ParentForm.TKroot, color=self.default_color) # show the 'get file' dialog box
AttributeError: module 'tkinter' has no attribute 'colorchooser'
Unless you add an extra import - from tkinter import colorchooser
Code To Duplicate
The text was updated successfully, but these errors were encountered: