how to change the style of a CTKwidget #2367
-
HI, Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Have you checked out CTkComboBox.configure api in the docs? |
Beta Was this translation helpful? Give feedback.
-
Hi @zorrolaotse, It is not possible to configure the style of the dropdown arrow. The dropdown arrow is created by the draw engine (canvas). requires_recoloring_2 = self.draw_engine.draw_dropdown_arrow(self._apply_widget_scaling(self._current_width - (self._current_height / 2)), self._apply_widget_scaling(self._current_height / 2), self._apply_widget_scaling(self._current_height / 3)) The above code in the The dropdown arrow color is linked to the font color, so changing the font color will also change the arrow color. However, you can independently change the color of the dropdown. But it's not recommended since it might change again back to the original color when you configure the button. Example Code combo = CTkComboBox(root, values=["Value 1", "Value 2", "Value 3"])
combo.pack(expand=True)
combo._canvas.itemconfig("dropdown_arrow", fill="yellow") I hope this helps |
Beta Was this translation helpful? Give feedback.
Hi @zorrolaotse,
It is not possible to configure the style of the dropdown arrow. The dropdown arrow is created by the draw engine (canvas).
The above code in the
ctk_combobox.py
draws the dropdown arrow.The dropdown arrow color is linked to the font color, so changing the font color will also change the arrow color. However, you can independently change the color of the dropdown. But it's not recommended since it might change again back to the…