Adjust Tkinter window and widjets according to screen resolution

1

Hello, I'm developing a python GUI with TKinter. I'm trying to make the widget setup I've set up to suit the monitor's resolution.

I applied the following code.

    janela = tk.Tk()

    lado, cima = (janela.winfo_screenwidth()), (janela.winfo_screenheight())

    janela.geometry('%dx%d+0+0' % (lado,cima))

But this only ensures that the window will open in the monitor resolution but does not adjust the dimensions of the widgets' pixels with the window.

Is this possible with TKinter?

    
asked by anonymous 20.12.2017 / 12:19

1 answer

0

Hello, sorry I did not respond soon, I was very busy. But it's as follows, there's no code I know of that leaves widgets , frames or / and label's as a dimension to fit monitor. Why think with me, if you pass an IDLE pro parameter so that setting the main screen to the monitor is ok, but then you should set a size for the objects placed inside the screen that will print, such as widgets , frames and label's tags. So the best output at the moment would be to organize your objects with Pack and Grid layout manager, could be in Line and Column in> if you do not set size or do not set the place where it should stay, it will give error, but its output is here:

Assemble your code structure, place buttons, label and etc., but in the end you pack everything and center. So when another user or yourself opens the program on another computer with another display resolution, the buttons, widgets and label's will always be in the center.

Well I hope I really helped, and I'm sorry again for not responding soon.

    
06.02.2018 / 18:06