Python 3 Tkinter Script to Hide or Disable Mouse Cursor in Window GUI Desktop App

You are currently viewing Python 3 Tkinter Script to Hide or Disable Mouse Cursor in Window GUI Desktop App

Python 3 Tkinter Script to Hide or Disable Mouse Cursor in Window GUI Desktop App

#Import tkinter library
from tkinter import *
from tkinter import ttk
#Create an instance of Tkinter frame or window
win = Tk()
#Set the geometry of tkinter frame
win.geometry("750x250")
 
 
def callback(event):
   win.destroy()
 
 
#Create a Label and a Button widget
label = ttk.Label(win, text="Press Enter to Close the Window",
                  font=('Century 17 bold'))
label.pack(ipadx=10)
win.bind('<Return>', callback)
#Disable the Mouse Pointer
win.config(cursor="none")
win.mainloop()

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply