Viktor Petrov
Viktor Petrov

Reputation: 37

Ctk ComboBox glitching out

As you can see, my text goes over the arrow, how can i fix it? this is my code:

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')

Text boundarie goes over the arrow

Upvotes: 0

Views: 89

Answers (1)

acw1668
acw1668

Reputation: 47085

The simple fix is to move the options in self.configure(...) back to 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')

Output:

enter image description here

Upvotes: 1

Related Questions