Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- import tkinter as tk
- from tkinter import messagebox as mb
- root = tk.Tk()
- root.minsize(1280, 720)
- root.attributes("-fullscreen", True)
- try:
- import time
- from threading import Thread
- import datetime
- try:
- import ast
- except ModuleNotFoundError:
- os.system('pip install ast')
- import ast
- try:
- import random
- except ModuleNotFoundError:
- os.system('pip install random')
- import random
- try:
- from PIL import Image, ImageTk
- except ModuleNotFoundError:
- os.system('pip install pillow')
- from PIL import Image, ImageTk
- PROGRAMLIST_STARTUP = open("T:/TechOS/Virtual/Settings/PROGRAMLIST_STARTUP.set", "r").read()
- RANDOMIZE_WALLPAPERS = open("T:/TechOS/Virtual/Settings/RANDOMIZE_WALLPAPERS.set", "r").read()
- TECHMAIL_STARTUP = open("T:/TechOS/Virtual/Settings/TECHMAIL_STARTUP.set", "r").read()
- SET_WALLPAPER = open("T:/TechOS/Virtual/Settings/SET_WALLPAPER.set", "r").read()
- DARK_SYSTEM_APPS = open("T:/TechOS/Virtual/Settings/DARK_SYSTEM_APPS.set", "r").read()
- ACCENT_COLOR = open("T:/TechOS/Virtual/Settings/ACCENT_COLOR.set", "r").read()
- LARGER_BORDERS = open("T:/TechOS/Virtual/Settings/LARGER_BORDERS.set", "r").read()
- def color_variant(hex_color, brightness_offset=1):
- """ takes a color like #87c95f and produces a lighter or darker variant """
- if len(hex_color) != 7:
- raise Exception("Passed %s into color_variant(), needs to be in #87c95f format." % hex_color)
- rgb_hex = [hex_color[x:x+2] for x in [1, 3, 5]]
- new_rgb_int = [int(hex_value, 16) + brightness_offset for hex_value in rgb_hex]
- new_rgb_int = [min([255, max([0, i])]) for i in new_rgb_int] # make sure new values are between 0 and 255
- # hex() produces "0x88", we want just "88"
- return "#" + "".join(["{:02x}".format(i) for i in new_rgb_int])
- try:
- BLACK_ACCENT_COLOR = color_variant(ACCENT_COLOR, -200)
- DIM_ACCENT_COLOR = color_variant(ACCENT_COLOR, -20)
- DARK_ACCENT_COLOR = color_variant(ACCENT_COLOR, -10)
- LIGHT_ACCENT_COLOR = color_variant(ACCENT_COLOR, 10)
- BRIGHT_ACCENT_COLOR = color_variant(ACCENT_COLOR, 20)
- WHITE_ACCENT_COLOR = color_variant(ACCENT_COLOR, 200)
- except ValueError:
- acfile = open("T:/TechOS/Virtual/Settings/ACCENT_COLOR.set", "w")
- acfile.write("#0090ff")
- acfile.close()
- raise Exception("Bad color name: " + ACCENT_COLOR)
- sysappbg = 'white'
- sysappfg = 'black'
- sysappacbg = 'lightgray'
- if DARK_SYSTEM_APPS == "True":
- sysappbg = 'gray10'
- sysappfg = 'gray90'
- sysappacbg = 'gray20'
- root.config(bg="white", cursor='@T:/TechOS/Virtual/Cursors/Arrow.ani')
- root.title("TechOS Virtual")
- root.resizable(False, False)
- root.update()
- wallpaperwidth = root.winfo_width()
- wallpaperheight = root.winfo_height()
- wallpaperfolder = os.listdir("T:/TechOS/Virtual/Images/Wallpapers")
- if RANDOMIZE_WALLPAPERS == "True":
- wallpaperpath = "T:/TechOS/Virtual/Images/Wallpapers/" + random.choice(wallpaperfolder)
- else:
- wallpaperpath = "T:/TechOS/Virtual/Images/Wallpapers/" + SET_WALLPAPER
- try:
- wallpaper0 = Image.open(wallpaperpath)
- wallpaper0 = wallpaper0.resize((wallpaperwidth, wallpaperheight), Image.ANTIALIAS)
- wallpaper = ImageTk.PhotoImage(wallpaper0)
- backgroundlabel = tk.Label(bg=ACCENT_COLOR)
- backgroundlabel.image = wallpaper
- backgroundlabel.config(image=backgroundlabel.image)
- backgroundlabel.place(x=0, y=0, relwidth=1.0, relheight=1.0)
- wallpaperloaded = True
- except FileNotFoundError:
- backgroundlabel = tk.Label(bg=ACCENT_COLOR)
- backgroundlabel.place(x=0, y=0, relwidth=1.0, relheight=1.0)
- wallpaperloaded = False
- def exit():
- exitsure = mb.askyesno("Exit TechOS Virtual", "Are you sure you want to exit TechOS?")
- if exitsure:
- root.destroy()
- sys.exit()
- else:
- pass
- neframe = tk.Frame(root, bg='white', bd=1, relief='solid')
- neframe.pack(side='top', anchor='ne')
- tosimage = tk.PhotoImage(file='T:/TechOS/Virtual/Images/TechOS Logo Shaded.png')
- smalltosimage = tosimage.subsample(2, 2)
- toslogo = tk.Label(neframe, bg='white')
- toslogo.image = smalltosimage
- toslogo.config(image=toslogo.image)
- toslogo.pack(side='top', anchor='ne', padx=5, pady=5)
- exitbutton = tk.Button(neframe, text="Exit Virtual", command=exit, bg='white', bd=0, fg='black', activeforeground=LIGHT_ACCENT_COLOR, activebackground=WHITE_ACCENT_COLOR)
- exitbutton.pack(side='top', anchor='ne', padx=5, pady=5)
- taskbar = tk.Frame(root, height=30, bd=0, bg='gray10')
- taskbar.pack(side='bottom', anchor='s', expand=True, fill='x')
- time_label = tk.Label(taskbar, text="??:?? ??", bg='gray10', width=10, fg='gray90')
- time_label.pack(side='right', anchor='e', fill='y')
- def clock():
- time1 = datetime.datetime.now().strftime("%H:%M/%p")
- time2, time3 = time1.split('/')
- hour, minutes = time2.split(':')
- if int(hour) > 12 and int(hour) < 24:
- time = str(int(hour) - 12) + ':' + minutes + ' ' + time3
- else:
- time = time2 + ' ' + time3
- time_label.config(text=time)
- time_label.after(1000, clock)
- Thread(target=clock, daemon=True).start()
- focused_window = None
- def create_window(x=100, y=100, width=400, height=300, title="Window", img="T:/TechOS/Virtual/Images/DefaultProgramIcon.png", program=None, code=None):
- global focused_window
- global LARGER_BORDERS
- parentframe = tk.Frame(root, bd=1, relief='solid', cursor='@T:/TechOS/Virtual/Cursors/MoveTLBR.ani')
- parentframe.place(x=x, y=y, width=width, height=height)
- if LARGER_BORDERS == 'True':
- parentframe.config(bd=2)
- frame0 = tk.Frame(parentframe, bd=0, relief='solid', bg='white', height=30, cursor='@T:/TechOS/Virtual/Cursors/Arrow.ani')
- frame0.pack(side='top', anchor='n', expand=False, fill='x')
- frame0.pack_propagate(0)
- frame1 = tk.Frame(parentframe, bd=0, relief='solid', bg='white', cursor='@T:/TechOS/Virtual/Cursors/Arrow.ani')
- frame1.pack(side='bottom', anchor='n', expand=True, fill='both')
- frame1.pack_propagate(0)
- titleimg = tk.PhotoImage(file=img)
- title = tk.Label(frame0, bg='white', text=' ' + title, justify='left', fg='gray50', compound='left')
- title.image = titleimg
- title.config(image=title.image)
- title.pack(side='left', anchor='w', padx=5)
- restorex = x
- restorey = y
- minstorex = x
- minstorey = y
- restorew = width
- restoreh = height
- max = False
- min = False
- closebutton = tk.Button(frame0, bg='white', text='⨉', fg='gray50', padx=15, bd=0, font='TkDefaultFont 12')
- closebutton.pack(side='right', anchor='e', fill='y')
- def clbhover(e):
- closebutton.config(bg='red', fg='white')
- def clbunhover(e):
- closebutton.config(bg=ACCENT_COLOR)
- def clbunhover2(e):
- closebutton.config(bg='white', fg='gray50')
- def clbpress(e):
- closebutton.config(bg='darkred')
- return "break"
- def clbunpress(e):
- px, py = root.winfo_pointerxy()
- widget = root.winfo_containing(px, py)
- if widget == closebutton:
- parentframe.destroy()
- try:
- tbutton.destroy()
- except:
- pass
- focused_window = None
- else:
- pass
- closebutton.bind("<Enter>", clbhover)
- closebutton.bind("<Leave>", clbunhover2)
- closebutton.bind("<Button-1>", clbpress)
- closebutton.bind("<ButtonRelease-1>", clbunpress)
- maxbutton = tk.Button(frame0, bg='white', text='△', fg='gray50', padx=15, bd=0, font='TkDefaultFont 12')
- maxbutton.pack(side='right', anchor='e', fill='y')
- def maxhover(e):
- maxbutton.config(bg=BRIGHT_ACCENT_COLOR)
- def maxhover2(e):
- maxbutton.config(bg='gray90')
- def maxunhover(e):
- maxbutton.config(bg=ACCENT_COLOR)
- def maxunhover2(e):
- maxbutton.config(bg='white')
- def maxpress(e):
- maxbutton.config(bg=DIM_ACCENT_COLOR)
- return "break"
- def maxpress2(e):
- maxbutton.config(bg='gray80')
- return "break"
- def maxunpress(e):
- nonlocal restorex
- nonlocal restorey
- nonlocal restorew
- nonlocal restoreh
- nonlocal minstorex
- nonlocal minstorey
- nonlocal max
- px, py = root.winfo_pointerxy()
- widget = root.winfo_containing(px, py)
- if widget == maxbutton:
- if max == False:
- restorex = parentframe.winfo_x()
- restorey = parentframe.winfo_y()
- restorew = parentframe.winfo_width()
- restoreh = parentframe.winfo_height()
- parentframe.place_configure(x=0, y=0, w=root.winfo_width(), h=root.winfo_height() - 30)
- maxbutton.config(text='▽')
- max = True
- minstorex = 0
- minstorey = 0
- elif max == True:
- parentframe.place_configure(x=restorex, y=restorey, width=restorew, height=restoreh)
- maxbutton.config(text='△')
- max = False
- minstorex = parentframe.winfo_x()
- minstorey = parentframe.winfo_y()
- else:
- pass
- lift('')
- maxbutton.bind("<Enter>", maxhover2)
- maxbutton.bind("<Leave>", maxunhover2)
- maxbutton.bind("<Button-1>", maxpress2)
- maxbutton.bind("<ButtonRelease-1>", maxunpress)
- def lift(e):
- global focused_window
- parentframe.lift()
- taskbar.lift()
- focused_window = parentframe
- parentframe.bind("<ButtonPress>", lift)
- frame0.bind("<ButtonPress>", lift)
- title.bind("<ButtonPress>", lift)
- for child in parentframe.winfo_children():
- child.bind("<ButtonPress>", lift)
- minbutton = tk.Button(frame0, bg='white', text='—', fg='white', padx=15, bd=0)
- minbutton.pack(side='right', anchor='e', fill='y')
- def minhover(e):
- minbutton.config(bg=BRIGHT_ACCENT_COLOR)
- def minhover2(e):
- minbutton.config(bg='gray90')
- def minunhover(e):
- minbutton.config(bg=ACCENT_COLOR)
- def minunhover2(e):
- minbutton.config(bg='white')
- def minpress(e):
- minbutton.config(bg=DIM_ACCENT_COLOR)
- return "break"
- def minpress2(e):
- minbutton.config(bg='gray80')
- return "break"
- def minunpress(e):
- nonlocal minstorex
- nonlocal minstorey
- nonlocal min
- global focused_window
- px, py = root.winfo_pointerxy()
- widget = root.winfo_containing(px, py)
- if widget == minbutton:
- if min == False:
- minstorex = parentframe.winfo_x()
- minstorey = parentframe.winfo_y()
- parentframe.place_configure(x=minstorex, y=2000)
- min = True
- elif min == True:
- parentframe.place_configure(x=minstorex, y=minstorey)
- min = False
- else:
- pass
- focused_window = None
- minbutton.bind("<Enter>", minhover2)
- minbutton.bind("<Leave>", minunhover2)
- minbutton.bind("<Button-1>", minpress2)
- minbutton.bind("<ButtonRelease-1>", minunpress)
- icon = tk.PhotoImage(file=img)
- tbutton = tk.Button(taskbar, bg='gray10', width=35, bd=0)
- tbutton.image = icon
- tbutton.config(image=tbutton.image)
- tbutton.pack(side='left', anchor='w', fill='y')
- def tbhover(e):
- tbutton.config(bg='gray20')
- def tbunhover(e):
- tbutton.config(bg='gray10')
- def tbpress(e):
- tbutton.config(bg='gray30')
- return "break"
- def tbunpress(e):
- px, py = root.winfo_pointerxy()
- widget = root.winfo_containing(px, py)
- if widget == tbutton:
- nonlocal minstorex
- nonlocal minstorey
- nonlocal min
- parentframe.place_configure(x=minstorex, y=minstorey)
- lift('')
- min = False
- focused_window = parentframe
- else:
- pass
- tbutton.config(bg='gray20')
- tbutton.bind("<Enter>", tbhover)
- tbutton.bind("<Leave>", tbunhover)
- tbutton.bind("<Button-1>", tbpress)
- tbutton.bind("<ButtonRelease-1>", tbunpress)
- def get_pos(event):
- lift(event)
- nonlocal restorex
- nonlocal restorey
- nonlocal restorew
- nonlocal restoreh
- nonlocal minstorex
- nonlocal minstorey
- nonlocal max
- xwin = parentframe.winfo_x()
- ywin = parentframe.winfo_y()
- startx = event.x_root
- starty = event.y_root
- ywin = ywin - starty
- xwin = xwin - startx
- justmax = False
- def move(event):
- nonlocal restorew
- nonlocal restoreh
- nonlocal max
- nonlocal justmax
- middle = restorew / 2
- if max == False:
- if justmax == False:
- parentframe.place_configure(x=event.x_root + xwin, y=event.y_root + ywin)
- elif justmax == True:
- parentframe.place_configure(x=event.x_root - middle, y=event.y_root + ywin)
- elif max == True:
- parentframe.place_configure(x=event.x_root - middle, y=event.y_root + ywin, width=restorew, height=restoreh)
- maxbutton.config(text='△')
- max = False
- justmax = True
- def complete(e):
- nonlocal restorex
- nonlocal restorey
- nonlocal minstorex
- nonlocal minstorey
- nonlocal justmax
- def completethread():
- time.sleep(0.1)
- nonlocal restorex
- nonlocal restorey
- nonlocal minstorex
- nonlocal minstorey
- restorex = parentframe.winfo_x()
- restorey = parentframe.winfo_y()
- minstorex = parentframe.winfo_x()
- minstorey = parentframe.winfo_y()
- nonlocal justmax
- justmax = False
- Thread(target=completethread, daemon=True).start()
- startx = event.x_root
- starty = event.y_root
- frame0.bind('<B1-Motion>', move)
- title.bind('<B1-Motion>', move)
- frame0.bind('<ButtonRelease-1>', complete)
- title.bind('<ButtonRelease-1>', complete)
- frame0.bind('<Button-1>', get_pos)
- title.bind('<Button-1>', get_pos)
- def get_pos2(event):
- lift(event)
- nonlocal restorex
- nonlocal restorey
- nonlocal restorew
- nonlocal restoreh
- nonlocal minstorex
- nonlocal minstorey
- nonlocal max
- xwin = parentframe.winfo_width()
- ywin = parentframe.winfo_height()
- startx = event.x_root
- starty = event.y_root
- def resize(event):
- nonlocal startx
- nonlocal starty
- nonlocal xwin
- nonlocal ywin
- nonlocal max
- endx = event.x_root
- endy = event.y_root
- diffx = endx - startx
- diffy = endy - starty
- newwidth = xwin + diffx
- newheight = ywin + diffy
- if newwidth >= 230:
- parentframe.place_configure(width=newwidth)
- if newheight >= 34:
- parentframe.place_configure(height=newheight)
- if max == False:
- pass
- elif max == True:
- maxbutton.config(text='△')
- max = False
- def complete(e):
- nonlocal restorew
- nonlocal restoreh
- def completethread():
- time.sleep(0.1)
- nonlocal restorew
- nonlocal restorew
- restorew = parentframe.winfo_width()
- restoreh = parentframe.winfo_height()
- Thread(target=completethread, daemon=True).start()
- startx = event.x_root
- starty = event.y_root
- parentframe.bind('<B1-Motion>', resize)
- parentframe.bind('<ButtonRelease-1>', complete)
- parentframe.bind('<Button-1>', get_pos2)
- def checkfocus():
- if tbutton.winfo_exists() and parentframe.winfo_exists():
- global focused_window
- if focused_window == parentframe and tbutton.winfo_exists() and parentframe.winfo_exists():
- try:
- px, py = root.winfo_pointerxy()
- widget = root.winfo_containing(px, py)
- if not widget == tbutton:
- tbutton.config(bg='gray20')
- frame0.config(bg=ACCENT_COLOR)
- title.config(bg=ACCENT_COLOR, fg='white')
- if not widget == closebutton:
- closebutton.config(bg=ACCENT_COLOR, fg='white')
- if not widget == maxbutton:
- maxbutton.config(bg=ACCENT_COLOR, fg='white')
- if not widget == minbutton:
- minbutton.config(bg=ACCENT_COLOR, fg='white')
- closebutton.bind("<Leave>", clbunhover)
- maxbutton.bind("<Enter>", maxhover)
- maxbutton.bind("<Leave>", maxunhover)
- maxbutton.bind("<Button-1>", maxpress)
- minbutton.bind("<Enter>", minhover)
- minbutton.bind("<Leave>", minunhover)
- minbutton.bind("<Button-1>", minpress)
- time.sleep(0.05)
- return Thread(target=checkfocus, daemon=True).start()
- except:
- pass
- elif tbutton.winfo_exists() and parentframe.winfo_exists():
- try:
- px, py = root.winfo_pointerxy()
- widget = root.winfo_containing(px, py)
- if not widget == tbutton:
- tbutton.config(bg='gray10')
- frame0.config(bg='white')
- title.config(bg='white', fg='gray50')
- if not widget == closebutton:
- closebutton.config(bg='white', fg='gray50')
- if not widget == maxbutton:
- maxbutton.config(bg='white', fg='gray50')
- if not widget == minbutton:
- minbutton.config(bg='white', fg='gray50')
- closebutton.bind("<Leave>", clbunhover2)
- maxbutton.bind("<Enter>", maxhover2)
- maxbutton.bind("<Leave>", maxunhover2)
- maxbutton.bind("<Button-1>", maxpress2)
- minbutton.bind("<Enter>", minhover2)
- minbutton.bind("<Leave>", minunhover2)
- minbutton.bind("<Button-1>", minpress2)
- time.sleep(0.05)
- return Thread(target=checkfocus, daemon=True).start()
- except:
- pass
- Thread(target=checkfocus, daemon=True).start()
- def runprogram():
- nonlocal program
- if program == None:
- if code == None:
- tk.Label(frame1, bg='white', text='Unable to load code for this window.').pack(anchor='n', side='top', pady=50)
- else:
- codeobject = compile(code, 'Unknown', 'exec')
- exec(codeobject, {"root": root, "openfile": openfile, "create_window": create_window, "startprogram": startprogram}, {"frame1": frame1, "parentframe": parentframe})
- else:
- f = open(program, 'r')
- code0 = f.read()
- f.close()
- codeobject0 = compile(code0, program, 'exec')
- exec(codeobject0, {"root": root, "openfile": openfile, "create_window": create_window, "startprogram": startprogram}, {"frame1": frame1, "parentframe": parentframe})
- Thread(target=runprogram, daemon=True).start()
- return parentframe
- def programmenu():
- global frame3
- try:
- if frame3.winfo_exists():
- frame3.destroy()
- else:
- raise(NameError)
- except NameError:
- frame3 = tk.Frame(root, width=500, height=600, bd=1, relief='solid', bg='white')
- closebutton = tk.Button(frame3, bg=sysappbg, text='⨉', fg='gray50', padx=15, bd=0, font='TkDefaultFont 12')
- closebutton.pack(side='right', anchor='ne')
- def clbhover(e):
- closebutton.config(bg='red', fg='white')
- def clbunhover2(e):
- closebutton.config(bg=sysappbg, fg='gray50')
- def clbpress(e):
- closebutton.config(bg='darkred')
- return "break"
- def clbunpress(e):
- px, py = root.winfo_pointerxy()
- widget = root.winfo_containing(px, py)
- if widget == closebutton:
- frame3.destroy()
- else:
- pass
- closebutton.bind("<Enter>", clbhover)
- closebutton.bind("<Leave>", clbunhover2)
- closebutton.bind("<Button-1>", clbpress)
- closebutton.bind("<ButtonRelease-1>", clbunpress)
- frame3.place(x=0, y=root.winfo_height() - 630, width=500, height=600)
- f = open('T:/Programs/ProgramList/ProgramList.tep', 'r')
- code0 = f.read()
- f.close()
- codeobject1 = compile(code0, 'T:/Programs/ProgramList/ProgramList.tep', 'exec')
- exec(codeobject1)
- def openfile(path):
- if path.endswith('.png') or path.endswith('.jpg') or path.endswith('.jpeg'):
- codefile = open('T:/Programs/ImageViewer/ImageViewer.tep', 'r')
- code1 = codefile.read()
- code2 = code1 + '\nloadimage(r"' + path + '")'
- create_window(width=600, height=400, title=os.path.basename(path), img="T:/Programs/ImageViewer/Attributes/Icon.png", code=code2)
- elif path.endswith('.tep'):
- programname = os.path.basename(path)[:-4]
- create_window(title=programname, program=path)
- else:
- codefile = open('T:/Programs/TechNotes/TechNotes.tep', 'r')
- code1 = codefile.read()
- code2 = code1 + '\nopen_file(r"' + path + '")'
- create_window(width=600, height=400, title="TechNotes", img="T:/Programs/TechNotes/Attributes/Icon.png", code=code2)
- def startprogram(name):
- infopath = 'T:/ProgramData/Info/' + name + '.info'
- try:
- infofile = open(infopath, 'r')
- infotext = infofile.read()
- info = ast.literal_eval(infotext)
- _title = info["TITLE"]
- _icon = info["ICONPATH"]
- _width = info["WINWIDTH"]
- _height = info["WINHEIGHT"]
- _program = info["PROGRAMPATH"]
- return create_window(title=_title, img=_icon, width=_width, height=_height, program=_program)
- except FileNotFoundError:
- return create_window(title=name)
- finally:
- global frame3
- if frame3.winfo_exists():
- programmenu()
- else:
- pass
- techpadicon1 = tk.PhotoImage(file='T:/TechOS/Virtual/Images/TechpadLogoWhite16px.png')
- techpadicon2 = tk.PhotoImage(file='T:/TechOS/Virtual/Images/TechpadLogoBlue16px.png')
- techpadbutton = tk.Button(taskbar, bg='gray10', width=35, bd=0)
- techpadbutton.image = techpadicon1
- techpadbutton.config(image=techpadbutton.image)
- techpadbutton.pack(side='left', anchor='w', fill='y')
- def tpbhover(e):
- techpadbutton.config(bg='gray20')
- techpadbutton.image = techpadicon2
- techpadbutton.config(image=techpadbutton.image)
- def tpbunhover(e):
- techpadbutton.config(bg='gray10')
- techpadbutton.image = techpadicon1
- techpadbutton.config(image=techpadbutton.image)
- def tpbpress(e):
- techpadbutton.config(bg='gray30')
- return "break"
- def tpbunpress(e):
- px, py = root.winfo_pointerxy()
- widget = root.winfo_containing(px, py)
- if widget == techpadbutton:
- programmenu()
- else:
- pass
- techpadbutton.config(bg='gray20')
- techpadbutton.bind("<Enter>", tpbhover)
- techpadbutton.bind("<Leave>", tpbunhover)
- techpadbutton.bind("<Button-1>", tpbpress)
- techpadbutton.bind("<ButtonRelease-1>", tpbunpress)
- tpbseparator = tk.Frame(taskbar, bg='gray90', width=1, height=20)
- tpbseparator.pack(anchor='w', side='left', padx=5, pady=5)
- if PROGRAMLIST_STARTUP == "True":
- programmenu()
- else:
- pass
- if TECHMAIL_STARTUP == "True":
- startprogram("TechMail")
- else:
- pass
- if wallpaperloaded == False:
- mb.showinfo("Failed to load image", "We were unable to find your custom wallpaper. Please try setting the wallpaper again or turn on \"Randomize Wallpapers\" in settings.")
- root.mainloop()
- except Exception as err:
- root.config(bg='#00afff')
- tk.Label(bg='#00afff', fg='white', text=f'Fatal Error\n\nTechOS has crashed for the following reason:\n\n{err}\n\nIf the problem persists, contact Techpad.\nPress any key to exit', font='tkDefaultFont 20', anchor='nw', padx=10, pady=10, justify='left', cursor='none').pack(expand=True, fill='both')
- def tosexit(e):
- root.destroy()
- sys.exit()
- root.bind("<Key>", tosexit)
- root.mainloop()
Add Comment
Please, Sign In to add comment