-
-
Save parzibyte/b4a9b5e87e1297307b030332b2a230eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def centrar(r): | |
altura = r.winfo_reqheight() | |
anchura = r.winfo_reqwidth() | |
altura_pantalla = r.winfo_screenheight() | |
anchura_pantalla = r.winfo_screenwidth() | |
print(f"Altura: {altura}\nAnchura: {anchura}\nAltura de pantalla: {altura_pantalla}\nAnchura de pantalla: {anchura_pantalla}") | |
x = (anchura_pantalla // 2) - (anchura//2) | |
y = (altura_pantalla//2) - (altura//2) | |
r.geometry(f"+{x}+{y}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment