This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author epaine
Recipients epaine, serhiy.storchaka, zjdavid
Date 2021-01-21.14:42:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611240158.3.0.971832718751.issue42977@roundup.psfhosted.org>
In-reply-to
Content
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()
tk.OptionMenu(root, tk.StringVar(), "test").pack(fill="x")

A bit more detail on the Tk side of things:
tkinter doesn't actually use `tk_optionMenu` and instead creates its own menubutton and menu. The issue with the menubutton width not changing also exists when working directly with Tk (`pack [menubutton .p -width 100]`). However, the same behaviour can be shown when using `tk_optionMenu`, so changing tkinter to use that instead would not fix this issue.
History
Date User Action Args
2021-01-21 14:42:38epainesetrecipients: + epaine, serhiy.storchaka, zjdavid
2021-01-21 14:42:38epainesetmessageid: <1611240158.3.0.971832718751.issue42977@roundup.psfhosted.org>
2021-01-21 14:42:38epainelinkissue42977 messages
2021-01-21 14:42:38epainecreate