0

Resize Buttons

How can I make the buttons resize automatically when maximizing the window in tkinter?

26th Apr 2020, 2:44 PM
Ahmad Tarek
Ahmad Tarek - avatar
1 Resposta
+ 2
Yes, Use the grid manager, give your widget a sticky. Then use grid_columnconfigure to give the column (or grid_rowconfigure for the row) an expansion weight. from Tkinter import * root=Tk() b=Button(root,text="Push Me") b.grid(column=1,row=1,sticky=E+W) root.grid_columnconfigure(1,weight=1) Source: https://stackoverflow.com/questions/51965602/JUMP_LINK__&&__python__&&__JUMP_LINK-tkinter-adjusting-button-size-to-window-size
26th Apr 2020, 2:51 PM
Gordon
Gordon - avatar