Message385426
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. |
|
Date |
User |
Action |
Args |
2021-01-21 14:42:38 | epaine | set | recipients:
+ epaine, serhiy.storchaka, zjdavid |
2021-01-21 14:42:38 | epaine | set | messageid: <1611240158.3.0.971832718751.issue42977@roundup.psfhosted.org> |
2021-01-21 14:42:38 | epaine | link | issue42977 messages |
2021-01-21 14:42:38 | epaine | create | |
|