We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ttkbootstrap Version: 1.10.1 OS: Windows language: zh_ch
获取颜色无法正常获取
from ttkbootstrap.dialogs import Querybox color = Querybox().get_color() print(color) # GET None print(type(color))
这是由于在 ttkbootstrap\dialogs\colorchooser.py 中只判断了等于 'OK', 但是在中文环境下按钮会返回 '确定'
def on_button_press(self, button): if button.cget('text') == 'OK': # <<<<<<<< this values = self.colorchooser.get_variables() self._result = ColorChoice( rgb=(values.r, values.g, values.b), hsl=(values.h, values.s, values.l), hex=values.hex ) self._toplevel.destroy() self._toplevel.destroy()
只需要修改这个判断程序就能正常工作, 下面这样的修改是正确的吗?
# change it if button.cget('text') == 'OK': if button.cget('text') == MessageCatalog.translate('OK'):
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Desktop (please complete the following information):
ttkbootstrap Version: 1.10.1
OS: Windows
language: zh_ch
Describe the bug
获取颜色无法正常获取
这是由于在 ttkbootstrap\dialogs\colorchooser.py 中只判断了等于 'OK', 但是在中文环境下按钮会返回 '确定'
只需要修改这个判断程序就能正常工作, 下面这样的修改是正确的吗?
The text was updated successfully, but these errors were encountered: