【发布时间】:2020-11-26 04:59:45
【问题描述】:
好的,所以我正在使用 tkinter 制作 GUI,我觉得顶部栏看起来有点难看,所以我打算删除它并放置一些漂亮的图标。我使用这行代码删除了顶部栏gui.overrideredirect(True),它可以工作:D,但是您不能在屏幕上移动程序(它会粘在屏幕的左上角)。有没有其他方法可以做到这一点而不把我的程序粘在角落里?谢谢。
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)
【问题讨论】: