0

Okay, so i am using tkinter to make a GUI, i feel like the top bar looks kinda ugly so that's why i was planning to remove it and put some nice icons. I used this line of code to remove the top bar gui.overrideredirect(True) and it worked :D, but you can't move the program around the screen (it sticks to the top-left corner of the screen). Is there any other way i can do this without sticking my program to the corner? Thanks.

import requests
import tkinter as tk


#GUI Config
gui = tk.Tk()
gui.geometry('970x569')
gui.title("Zombs Royale Tools v1")
gui.resizable(False, False)

#Code below is the one i used to do this[![enter image description here][1]][1]
gui.overrideredirect(True) 


#Background-image
bgImage = tk.PhotoImage(file="width.png")
background_label = tk.Label(gui, image = bgImage)
background_label.place(x=0,y=0,relwidth=1, relheight=1)

#GUI Widgets#

#Exit Button
exit_image = tk.PhotoImage(file="close.gif")
exit_button = tk.Button(gui, image=exit_image, borderwidth=0, command=gui.destroy)
exit_button.place(rely=0.01, relx=0.01)
Wolly ZR
  • 15
  • 3

1 Answers1

1

Removing the titlebar is done with override redirect. However, this removes every window function as well. That includes moving the window around and resizing it. This means with overrideredirect you can skip the

gui.resizable(False, False)

One thing you can do is provide more info for the window’s geometry:

gui.geometry('970x569+600+500')

The 2 last numbers provide the info regarding the positioning of your window on the desktop, in case you don’t want it to be spawned on the top left corner.

If you want to make the window movable you will have to integrate your own code. It has been discussed here before. Eg. here

qeiynn
  • 43
  • 6