如您所见,我的文字超出了箭头,我该如何修复它? 这是我的代码:
class ComboBox(ctk.CTkComboBox):
def __init__(self, master):
super().__init__(master)
self.configure(values=["Arduino Full Kit", "Arduino Basics Kit", "Arduino"],
#fg_color="#78BCC4",
text_color="#002C3E",
width=300,
height=50,
hover=True,
dropdown_hover_color='green',
variable=ctk.StringVar(value="Product...\n"),
state='readonly')
简单的修复方法是将
self.configure(...)
中的选项移回 super().__init__()
:
class ComboBox(ctk.CTkComboBox):
def __init__(self, master):
super().__init__(master,
values=["Arduino Full Kit", "Arduino Basics Kit", "Arduino"],
#fg_color="#78BCC4",
text_color="#002C3E",
width=300,
height=50,
hover=True,
dropdown_hover_color='green',
variable=ctk.StringVar(value="Product...\n"),
state='readonly')
输出: