
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Creating a Frameless Window in Python Tkinter
Tkinter is the most commonly used Python library for creating GUI-based applications. It has features like adding widgets and other necessary attributes.
Let us suppose that we want to create a borderless window using tkinter. To create a borderless window, we can use the overrideredirect method which basically disables the window and removes the window element such as the closing button, title, minimization element and buttons, etc.
overrideredirect is a Boolean function which can be either True or False. Once the window is opened, it can be closed by pressing Alt+F4.
Example
#Importing the tkinter library from tkinter import * #Create an instance of tkinter frame win= Tk() #Define the size of the window or frame win.geometry("700x400") #Define the window text widget lab= Label(win, text= "Hello World", font=('Time New Roman', 35), fg="green", anchor= "c").pack() #Make the window borderless win.overrideredirect(True) win.mainloop()
Output
Running the above code will generate the output and will show a borderless window.
Advertisements