Answers for "set the window on screen python tkinter"

10

python tkinter window fullscreen

import tkinter as tk
root = tk.Tk()

root.attributes('-fullscreen',True)
Posted by: Guest on November-12-2020
-1

splash screen in python tkinter

# READ THE COMMENTS!

<window name>.overrideredirect(1) # Replace "<window name>" with the name of your window

w = * # width for the Tk root (Replace The * With The Width Of Your Window)
h = * # height for the Tk root (Replace The * With The Height Of Your Window)

# get screen width and height
ws = <window name>.winfo_screenwidth() # width of the screen (Replace "<window name>" with the name of your window)
hs = <window name>.winfo_screenheight() # height of the screen (Replace "<window name>" with the name of your window)

# calculate x and y coordinates for the Tk root window
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)

# set the dimensions of the screen 
# and where it is placed
<window name>.geometry('%dx%d+%d+%d' % (w, h, x, y)) # Replace "<window name>" with the name of your window
Posted by: Guest on September-27-2021

Code answers related to "set the window on screen python tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language