Closed AESilky closed 9 months ago
I added the old MorseKOB icon to the MKOB title bar. We can replace it with a different icon later if someone gets creative. I've included this change in the latest commit to the lk-57-Fix-reader-window-jitter branch. I'll create a pull request for this branch once I've converted the GUI to Tkinter.ttk widgets.
I don't know how to change the program's icon on the task bar, even though I once found a way to do this for MorseKOB 2.5.
Thanks for putting this in.
Can you put a dash '-' in place of the space ' ' in this icon filename: 'MorseKOB Icon.ico' => 'MorseKOB-Icon.ico'
Spaces are handled, but not convenient, in command-line, scripts, etc.
I would create a folder for icons
(or such) and put the .ico
file there. We might add more icons for things in the UI and this will be a good place for them.
There are a few 'Python file structure' guides (though I didn't find one that specifically called out images and icons): (for example) https://realpython.com/python-application-layouts/
I found: "You can't add a custom icon to a plain Python script" in https://stackoverflow.com/questions/16782047/how-to-add-an-icon-of-my-own-to-a-python-program
.
It mentioned py2exe
(http://www.py2exe.org/) for windows. With that, you don't need to install Python and you can assign an icon for the application.
I found this, which might suggest a more generic solution: https://stackoverflow.com/questions/33134594/set-tkinter-python-application-icon-in-mac-os-x
Can you put a dash '-' in place of the space ' ' in this icon filename: 'MorseKOB Icon.ico' => 'MorseKOB-Icon.ico'
I'd be happy to change the filename and move the file to a different directory. Instead of just putting in a dash for the space, should we give it a more Python-like name? Maybe all lowercase? What would you call the icon file if you were doing it from scratch? All I did was blindly copy the file from the MorseKOB 2.5 project, so don't be influenced by that.
And where's the best place to put the icon file? In PyKOB/images? PyKOB/MKOB/images?
This is not an immediate issue, because I discovered today that the mechanism I was using to put the icon on the title bar causes Python to crash with Linux. So I've disabled it until we can figure out what works on multiple platforms.
It mentioned
py2exe
(http://www.py2exe.org/) for windows. With that, you don't need to install Python and you can assign an icon for the application.
This is huge! I was afraid coming up with a dead simple installation procedure for the MorseKOB app might be Python's Achilles heel. This could be the solution.
Also found PyInstaller:
PyInstaller freezes (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.
A guide to using it: PyInstaller Tutorial
It might be better since it indicates it is cross-platform.
I would put the icon in: PyKOB/MKOB/resources
Also found PyInstaller:
Wonderful! I can't wait to try it.
Implemented in MKOB 4.1
Currently when the MorseKOB application is running the icon displayed in the taskbar is the default
Python Launcher
icon:Users would find it easier to select the application if the taskbar icon was a more appropriate 'key', 'sounder', 'kob', or similar icon.