I am designing a simple Tkinter GUI program that prints out a table according to a SQL query. However, since I'm not sure how big the query will be, I was wondering if there's a way for the tkinter window to automatically change size to fit the contents? I will be displaying the data just using labels.
Asked
Active
Viewed 42 times
-1
-
Read [Adding a scrollbar to a group of widgets](https://stackoverflow.com/a/3092341/7414759) – stovfl May 25 '20 at 07:56
1 Answers
0
well, i'm not sure what you mean but you can try this code:
`from tkinter import *
window = Tk() window.geometry('800x600')
def test(): window.geometry('600x400')
button = Button(text='test', command=test, font=('times new roman', 30)) button.pack(pady=15)
mainloop()`
if you want the window to automatically to resize you can use if statements but i would need to see some code to know what you're trying to do!

Joshua Gonzalez
- 55
- 1
- 4