-
-
Notifications
You must be signed in to change notification settings - Fork 30k
-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
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
Tkinter Optionmenu Too Narrow on Mac #87143
Comments
Hello, I am building a program with Tkinter. However, I found the Optionmenu widget has inconsistent behaviors on default lengths on a Mac and a Windows PC. So I set the width of an optionmenu through menu.configure(width=70). On Windows, this correctly sets the menu width to 70 when the program runs. However, on a Mac, the menu is still very narrow at the start. It only expands to 70 after I select an option. I have attached a screenshot to help explain the issue. It does not occur on Windows. |
I suspect this is just a MacOS behaviour, if not then it is a Tk bug. If you really need to enforce the width, you could tell it to expand horizontally in the layout. An example of this would be as follows: tk.Frame(root, height=1, width=300).pack() A bit more detail on the Tk side of things: |
This should likely be closed as 3rd party zjdavid Which python release, which macOS, which installer, which tk patchlevel? (IDLE Help=>About displays it). At least one of the 3.9.1 python.org mac installers installs 8.6.10. We cannot be responsible for problems fixed in this release. |
I concur with E. Paine that you should use pack(fill="x") if you want to stretch a widget. And in any case Tkinter itself does not manage layout, it is just a wrapper around Tk, so if you think that the default layout of a button is wrong on some platforms, you should report it to the Tk team. |
Thanks for your help! I agree that it is probably a Tk issue. I will contact them and back with more information. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: