How to make a OptionMenu maintain the same width?

后端 未结 3 1627
北荒
北荒 2021-01-11 15:09

I have a snippet which creates an OptionMenu widget.

...
options = (\'White\', \'Grey\', \'Black\', \'Red\', \'Orange\', 
           \'Yellow\'         


        
相关标签:
3条回答
  • 2021-01-11 15:19
    optionmenu.configure(width=<YOUR_WIDTH_HERE>)
    
    0 讨论(0)
  • 2021-01-11 15:37

    When you use the grid command to place the widget in its parent, have the widget fill its cell (try sticky="ew")

    0 讨论(0)
  • 2021-01-11 15:44

    To the best of my knowledge, you can use optionmenu.config(width=<YOUR_WIDTH>) as follows:

    ...
    optionmenu = OptionMenu(par, var, *options)
    optionmenu.config(width=<YOUR_WIDTH>)
    optionmenu.grid(column=column, row=row)
    ...
    
    0 讨论(0)
提交回复
热议问题