Skip to content

Commit

Permalink
fix the logo is shown in the windows's title.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonWong08 committed Aug 22, 2023
1 parent 2c622d8 commit 22a3480
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions pyUI/Calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self,model,lan):
self.calibSliders = list()
self.OSname = self.winCalib.call('tk', 'windowingsystem')
if self.OSname == 'win32':
self.winCalib.iconbitmap(resourcePath + 'Petoi.ico')
self.calibButtonW = 8
else:
self.calibButtonW = 4
Expand Down
10 changes: 5 additions & 5 deletions pyUI/FirmwareUploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def buildMenu(self):
self.win.configure(menu=self.menuBar)

if self.OSname == 'win32':
self.win.iconbitmap(r'{}Petoi.ico'.format(resourcePath))
self.win.iconbitmap(resourcePath + 'Petoi.ico')

self.helpMenu = Menu(self.menuBar, tearoff=0)
self.helpMenu.add_command(label=txt('labAbout'), command=self.about)
Expand Down Expand Up @@ -111,7 +111,7 @@ def initWidgets(self):
print ('Create configuration file')
self.defaultLan = 'English'
model = 'Bittle'
strDefaultPath = releasePath
strDefaultPath = releasePath[:-1]
strSwVersion = '2.0'
strBdVersion = NyBoard_version_list[-1]
mode = 'Standard'
Expand Down Expand Up @@ -351,7 +351,7 @@ def formalize(self, strdir=' '):
sep = "/"
listDir = strdir.split("/")
if (strdir == str(pathlib.Path().resolve())):
strdir = sep.join(listDir) + '/release'
strdir = sep.join(listDir) + sep + "release"
else:
if (listDir[-1].find("release") == -1) and len(listDir) >= 2:
while listDir[-1].find("release") == -1 and len(listDir) >= 2:
Expand All @@ -366,8 +366,8 @@ def formalize(self, strdir=' '):
def open_dir(self):
# call askdirectory to open file director
logger.debug(f"{self.strFileDir.get()}")
if (self.strFileDir.get()).find(releasePath) != -1:
initDir = releasePath
if (self.strFileDir.get()).find(releasePath[:-1]) != -1:
initDir = releasePath[:-1]
else:
initDir = self.strFileDir
dirpath = filedialog.askdirectory(title=txt('titleFileDir'), initialdir=initDir)
Expand Down
4 changes: 2 additions & 2 deletions pyUI/SkillComposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self,model, lan):
except Exception as e:
print('Create configuration file')
self.defaultLan = 'English'
self.defaultPath = releasePath
self.defaultPath = releasePath[:-1]
self.defaultSwVer = '2.0'
self.defaultBdVer = NyBoard_version
self.defaultMode = 'Standard'
Expand Down Expand Up @@ -1371,7 +1371,7 @@ def getCreatorInfo(self, modifyQ):
print('Create configuration file')
defaultLan = self.defaultLan
defaultModel = self.model
defaultPath = releasePath
defaultPath = releasePath[:-1]
defaultSwVer = '2.0'
defaultBdVer = NyBoard_version
defaultMode = 'Standard'
Expand Down
6 changes: 3 additions & 3 deletions pyUI/UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self):
print('Create configuration file')
self.defaultLan = 'English'
model = 'Bittle'
self.defaultPath = releasePath
self.defaultPath = releasePath[:-1]
self.defaultSwVer = '2.0'
self.defaultBdVer = NyBoard_version
self.defaultMode = 'Standard'
Expand All @@ -66,14 +66,14 @@ def __init__(self):

self.OSname = self.window.call('tk', 'windowingsystem')
if self.OSname == 'win32':
self.window.iconbitmap(r'{}Petoi.ico'.format(resourcePath))
self.window.iconbitmap(resourcePath + 'Petoi.ico')
self.window.geometry('398x270+800+400')
elif self.OSname == 'aqua':
self.window.geometry('+800+400')
self.backgroundColor = 'gray'
else:
self.window.tk.call('wm', 'iconphoto', self.window._w, "-default",
PhotoImage(file= r'{}Petoi.png'.format(resourcePath)))
PhotoImage(file= resourcePath + 'Petoi.png'))
self.window.geometry('+800+400')

self.myFont = tkFont.Font(
Expand Down
2 changes: 1 addition & 1 deletion pyUI/commonVar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
sys.path.append('../serialMaster/')
resourcePath = './resources/'
releasePath = './release'
releasePath = './release/'
sys.path.append(resourcePath)
from ardSerial import *
from tkinter import *
Expand Down

0 comments on commit 22a3480

Please sign in to comment.