Desktop (please complete the following information):
ttkbootstrap version 1.10.0
OS: Windows 11
Describe the bug
when system language is Chinese, the OK and Cancel button on ColorChooserDialog will be translate to 【确定】and【取消】,but in ColorChooserDialog.on_button_press method, it check whether the text of button is "OK", to decide output results or not (see line 561 in file dialogs/colorchooser.py). So that we can't get the result of ColorChooserDialog.__
To Reproduce
in Chinese system language
Go to ColorChooserDialog
click 【确定】
see error
Expected behavior
I override the on_button_press method (see below), and it works now. but it is evident that this approach is not robust for other system languages. Hope this will be helpful.
class ColorChooserDialog(colorchooser.ColorChooserDialog):
def on_button_press(self, button):
if button.cget('text') in ('OK','确定'):
values = self.colorchooser.get_variables()
self._result = colorchooser.ColorChoice(
rgb=(values.r, values.g, values.b),
hsl=(values.h, values.s, values.l),
hex=values.hex
)
self._toplevel.destroy()
self._toplevel.destroy()
Desktop (please complete the following information):
ttkbootstrap version 1.10.0 OS: Windows 11
Describe the bug
when system language is Chinese, the OK and Cancel button on ColorChooserDialog will be translate to 【确定】and【取消】,but in ColorChooserDialog.on_button_press method, it check whether the text of button is "OK", to decide output results or not (see line 561 in file dialogs/colorchooser.py). So that we can't get the result of ColorChooserDialog.__
To Reproduce
Expected behavior
I override the on_button_press method (see below), and it works now. but it is evident that this approach is not robust for other system languages. Hope this will be helpful.
Screenshots
No response
Additional context
No response