Skip to content

Commit

Permalink
Native Windows WIndows!
Browse files Browse the repository at this point in the history
  • Loading branch information
Sfever authored Apr 12, 2024
1 parent 8fabd66 commit 9978bd6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
7 changes: 3 additions & 4 deletions codes/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self):
self.configExist=1
if self.configExist==0:
warnings.warn("config.json can not be read,loading defaults...")
self.popupManager.ShowWarning("Config Not found!")
self.popupManager.ShowNativePop("a","a")
for i in tr.trange(100):
time.sleep(round(random.uniform(0.01,0.2),2))#absolutely weird, this progress bar indicates nothing
self.W_width=720
Expand Down Expand Up @@ -75,11 +75,10 @@ def OnQuit(self):
end_time=time.time()
print("quit success, run time",(end_time-self.start_time),"seconds")
sys.exit()
def GetConfig(self)->list:
def GetConfig(self)->dict:
if self.configExist==1:
with open(self.configPath,'r') as config_reader:
config=json.load(config_reader)
return config
else:
return []

return {}
21 changes: 16 additions & 5 deletions codes/popup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
from tkinter import messagebox
import sys
import os
class PopupWindow():
def __init__(self) -> None:
pass
def ShowPopupWindow(self,message):
messagebox.showinfo("Notice",message)
def __init__(self,nativepath="./x64/Debug") -> None:
self.allownative=False
if os.path.exists(nativepath):
sys.path.append(nativepath)
from nativepopup import PopWin
self.allownative=True
def ShowPopupWindow(self,title,message):
messagebox.showinfo(title,message)
def ShowWarning(self,message):
messagebox.showwarning("Warning",message)
messagebox.showwarning("Warning",message)
def ShowNativePop(self,title,message):
if self.allownative==False:
self.ShowPopupWindow(title,message)
from nativepopup import PopWin
PopWin("test","test114")
Empty file added x64/Debug/placeholder
Empty file.
Empty file added x64/placeholder
Empty file.

0 comments on commit 9978bd6

Please sign in to comment.