Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_Zero_Window_Frame.py -- sort of hack
- try:
- from Tkinter import *
- except:
- from tkinter import *
- import time
- to_exit = 'you may left-click mouse directly on\nthis text to exit'
- mask = "#393939"
- def colorYield():
- while 1:
- for r in range(0,255,16):
- for g in range(0,255,16):
- for b in range(0,255,16):
- if r+g+b > 80*3:
- break
- t = '#%02x%02x%02x'%(r,g,b)
- yield t
- color = colorYield()
- root = Tk()
- ww = root.winfo_screenwidth()
- hh = root.winfo_screenheight()
- root.geometry(str(ww+10)+"x"+str(hh+10)+"+-10+-32") # to hide the frame
- root.title('Zero Window Frame')
- root.attributes("-transparentcolor", mask)
- root.configure(background=mask)
- e=Label(root, text=to_exit, padx=30, anchor='s', bg=mask, width=ww, height=3, font=('Helvetica', 50, 'italic'), fg=next(color))
- e.pack()
- t=Label(root, padx=0, anchor='sw', bg=mask, width=ww, font=('Helvetica', 250, 'bold italic'), fg='red')
- t.pack()
- root.pack_propagate(0)
- def exit(event=0):
- root.destroy()
- def update_clock():
- now = time.strftime("%H:%M:%S")
- t.configure(text=now)
- root.after(1000, update_clock)
- def update_color():
- e.configure(fg=next(color))
- root.after(50, update_color)
- root.bind('<Button-1>', exit)
- update_clock()
- update_color()
- root.mainloop()
Add Comment
Please, Sign In to add comment