Get Height and Width Of Tkinter App - Python Tkinter GUI Tutorial #82

preview_player
Показать описание
In this video I'll show you how to get the height, width, x, and y coordinates for your tkinter app programatically.

After your app runs, a user might resize it, or you might resize it as well based on user input or something else. There are times when you might need to know your apps current height and width.

In this video I'll show you how to get that info using:
winfo_geometry()
winfo_height()
winfo_width()
winfo_x()
winfo_y()

It's super easy!
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

Hit that like button Python Fans! Great tutorial. Feed the Algorithm!

RyanDanielG
Автор

Thanks! I used it to resize the background image of my app :)

whitebird
Автор

how do you get the size of any app that's running on my computer?

wowgodz-
Автор

Sir, is it possible to programmatically minimize, maximize and restore windows ??

ClusterSeries
Автор

hello, well explained as usual but how to make the dimensions of the window "tkinter" identical to those of the screen resolution? thanks

LaurentChastain
Автор

Hey would you be able to show how to make a scrollable window within an app? With multiple frames in the window.

austin
Автор

Winfo_width() and winfo_height() is always returning 1 on my end. can you help?

skyblueflower
Автор

Nice, woh i use geometry in Burton?
How can i use geometry in buttons, and imagens ?

Matheussilva-vgnx
Автор

How do I get screen resolution of like google chrome or other application?

dragonballclips
Автор

Your code requires the Button to be clicked each time you make a change (either changing the window size or the position). Is it possible to create a Label Field which dynamically updates the window size info, each time a change is made, without the need for clicking the button?

gauravkamila
Автор

What if you want to retrieve the widgets' width values, such as labels, entries, etc, Sir.

Because what will appear in the width value is still the pixel resolution, not the width unit of the widget.


sample case :

from tkinter import *

win=Tk()

Entry1=Entry(win, width=60)
Entry1.pack()
Entry1.insert(0, "Entry1")

Entry1.update()


win.mainloop()

then what will happen is : the width of the widget is 486

and I have to change that value again in a less simple way, like:






The value of 170 which I have deduced is to be the divisor of the screen pixels, so as to get the actual widget width value (60) to use.

IS THERE A SIMPLE AND STANDARD WAY?

forus
Автор

How to resize the widgets proportionally when a window is resized by the users?

sridharsivaraju
Автор

next video do how to make sound plz :)

midnightdev
Автор

it really is not possible to use the geometry for the button, one solution I found was to leave the image in the geometry I wanted and add it to the button.

Matheussilva-vgnx
Автор

HELLO TEACHER.
WHEN I WRITE THIS CODE the wind not open and error happen I don't know where is the problem

Abdulaziz-e-
welcome to shbcf.ru