How to control alignment and width of CtkOptionMenu? #1878
Unanswered
Rawalanche
asked this question in
Q&A
Replies: 1 comment
-
Helo there! use: 'dynamic_resizing=False' inside the OptionMenu self.source_channel_menu = customtkinter.CTkOptionMenu(self, values=self.source_channel_names, command=self.on_source_channel_menu_clicked, width=10, dynamic_resizing=False) -> dynamic_resizing=False was added |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am having several separate issues trying to precisely position CtkOptionMenu in my application. Here's the code to begin with:
My first problem is that I can not find a way to enforce minimum width of the UI element. I can't find any argument that would force the option menu to respect the width instead of expanding based on the value. In the code above, the width of self.source_channel_menu is mere 10 units, but in the application, it expands:
My next problem is that when I specify wide enough width, I can not figure out how to define maximum width, so that the widget doesn't expand when the selected option string is wider than the width value. On the screenshot below, the option menus have width of 150, but user can enter option so long the widget uncontrollably expands:
My last problem is that when I have widgets of various widths, for example as a side effect of my question 1. where there appears to be implicit minimum width I can not figure out how to control, I can't figure out how to customize alignment of these widgets. Let's say I would like to align them all to the left. I will set the anchor of the widget to "w' and when placing it into the grid, I will define sticky to "W" as well.
Neither of these will make the widgets actually align to the left thought, they are still aligned to the right:
So my questions are:
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions