MorseKOB / PyKOB

Python implementation of a library for Morse and MorseKOB functionality
https://sites.google.com/site/morsekob/morsekob40
MIT License
4 stars 2 forks source link

MKOB: Display application appropriate icon in taskbar when running #65

Closed AESilky closed 9 months ago

AESilky commented 4 years ago

Currently when the MorseKOB application is running the icon displayed in the taskbar is the default Python Launcher icon:

Screen Shot 2020-06-07 at 12 48 27 AM

Users would find it easier to select the application if the taskbar icon was a more appropriate 'key', 'sounder', 'kob', or similar icon.

leskerr commented 4 years 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.

AESilky commented 4 years ago

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.

AESilky commented 4 years ago

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/

AESilky commented 4 years ago

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

leskerr commented 4 years ago

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.

leskerr commented 4 years ago

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.

AESilky commented 4 years ago

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.

AESilky commented 4 years ago

I would put the icon in: PyKOB/MKOB/resources

leskerr commented 4 years ago

Also found PyInstaller:

Wonderful! I can't wait to try it.

AESilky commented 9 months ago

Implemented in MKOB 4.1