doga
6
try:
from Tkinter import *
except ImportError:
from tkinter import *
def frame_mapped(event):
root.update_idletasks()
root.overrideredirect(True)
root.state('normal')
def minimize(event):
root.update_idletasks()
root.overrideredirect(False)
# root.state('withdrawn')
root.state('iconic')
def exitProgram(event):
root.destroy()
root = Tk()
root.title("Draggable Root")
root.geometry("500x600")
root.overrideredirect(True)
borderFrame = Frame(root, width=500, height=600, bg="Gray")
borderFrame.pack_propagate(False)
borderFrame.pack(side=TOP)
borderFrame.bind("<Map>",frame_mapped)
holderFrame = Frame(borderFrame, width=500, height=570, bg="blue")
holderFrame.pack_propagate(False)
holderFrame.pack(side=BOTTOM)
close = Label(root, font=("Arial", 11), bg="Gray", anchor=CENTER, text="X", cursor="hand2")
close.place(x=460, y=0, width=40, height=30)
close.bind("<Button-1>", exitProgram)
min = Label(root, font=("Arial", 11), bg="Gray", anchor=CENTER, text="_", cursor="hand2")
min.place(x=420, y=0, width=40, height=30)
min.bind("<Button-1>", minimize)
root.mainloop()