Removing Title bar in Tkinter program

0 votes
I am working on a project using Tkinter library for making a GUI. This GUI will be displayed on a touch screen using raspberry pi 3.

I want to prevent user from exiting or minimising the program. Is there any way to disable or remove the title bar? Or is there a better way to achieve this?
Dec 26, 2018 in Python by ana1504.k
• 7,890 points
7,944 views

2 answers to this question.

0 votes
Since you mentioned a raspberry pi I suppose you are using Linux. In this case you can use root.attributes('-type', 'dock') (assuming your Tk instance is called root). This way, your window will have no decoration (so no close or minimize buttons) and will be always on top. If you don't want it always on top, you can use type 'splash' instead. In any case, you will need to use focus_force to be able to get keyboard focus.

import tkinter as tk

root = tk.Tk()
root.attributes('-type', 'dock')
root.geometry('200x200')
tk.Entry(root).pack()
root.focus_force()
root.mainloop()
answered Dec 26, 2018 by SDeb
• 13,250 points
+1 vote

you can remove the title bar by using this line of code

root.overrideredirect(True) # removes title bar

answered Mar 19, 2019 by anonymous
This is difficult to iconify/deiconify, and it cannot receive keyboard input.
Hey, Do you want an on-screen keyboard? This is what you meant?

Related Questions In Python

0 votes
1 answer

How change title bar background color in python tkinter?

You cant change colour cause its the ...READ MORE

answered Jun 9 in Python by bezlin
3,102 views
0 votes
0 answers

Storing a list of arrays into a CSV file and retrieving it back in a different program

This is the code that I am ...READ MORE

Jun 6, 2018 in Python by aryya
• 7,380 points
524 views
0 votes
1 answer

How to get a Mongoengine's object id in a flask program

Check out the documentation, Document.objects is a QuerySet object. You seem to be ...READ MORE

answered Sep 21, 2018 in Python by charlie_brown
• 7,780 points
306 views
0 votes
1 answer

Is there a way of using .lower more effectively in tkinter?

Here is a simple function and some ...READ MORE

answered Sep 25, 2018 in Python by Priyaj
• 57,640 points
535 views
0 votes
1 answer

how to get mongoengine object id in flask program

Check out the documentation, Document.objects is a QuerySet object. You seem to be ...READ MORE

answered Oct 5, 2018 in Python by Priyaj
• 57,640 points
2,802 views
0 votes
1 answer

how to get mongoengine object id in flask program

Check out the documentation, Document.objects is a QuerySet object. You seem to be ...READ MORE

answered Oct 10, 2018 in Python by Priyaj
• 57,640 points
143 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,357 views
0 votes
0 answers