PySimpleGUI / psgtray

A System Tray Icon that works with the PySimpleGUI tkinter port. Uses pystray to supply the system tray. Works well under Windows.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo error?

eagleEggs opened this issue · comments

Hello!

Attempting to run this demo on latest PSG / Windows 10. Wondering is this has just been broken by updates perhaps - Or I'm doing something wrong!

Error:

Traceback (most recent call last):
  File "C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner
    self.run()
  File "C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Name\PycharmProjects\_taMain\venv\lib\site-packages\psgtray\psgtray.py", line 181, in _pystray_thread
    self.tray_icon = pystray.Icon(self.title, self._create_image(self.icon))
  File "C:\Users\Name\PycharmProjects\_taMain\venv\lib\site-packages\pystray\_win32.py", line 32, in __init__
    super(Icon, self).__init__(*args, **kwargs)
  File "C:\Users\Name\PycharmProjects\_taMain\venv\lib\site-packages\pystray\_base.py", line 84, in __init__
    self._menu = menu if isinstance(menu, Menu) else Menu(*menu)
TypeError: pystray._base.Menu() argument after * must be an iterable, not NoneType
Exception ignored in: <function Icon.__del__ at 0x000001F897F3A940>
Traceback (most recent call last):
  File "C:\Users\Name\PycharmProjects\_taMain\venv\lib\site-packages\pystray\_win32.py", line 50, in __del__
    if self._running:
AttributeError: 'Icon' object has no attribute '_running'

Thanks!!!

Tracked back to the other issue with same error - Thanks.

Looling on PyPI, there have been quite a number of changes that I've not tested with.

This repo is 7 months old. I didn't specify any versions of pystray but seems like I should.

image

Oh... what was the resolution? Is it not a problem?

image

I'm still getting the error. Hard to see what's going on with this issue on pystray but maybe I need a different branch of it... ?

moses-palmer/pystray#101

I'm on Windows 10 but this person had the same error on MacOS -While saying it was working on Windows back then.

Yea I'm getting the error even when running the examples from the pystray docs. So this isn't really on PSG side.

https://pystray.readthedocs.io/en/latest/usage.html#creating-a-system-tray-icon

I'm running version 0.18 on my system with PySimpleGUI version 4.56.0. Both the pingmote and PySimpleHotkey (https://github.com/PySimpleGUI/PySimpleHotkey) are running using older versions of pystray.

image

image

On 3.6 I'm running pystray 0.18 and on 3.9 I'm running 0.17.3

image

PySimpleHotKey is not running either with the same error for pystray in _win32.py.

I've set up a new project with these versions:

PYTHON: 3.9.6
PSGTRAY: 1.0.1
PYSTRAY: 0.19.2
PSG: 4.56.0

Hmm...

Let me try getting the versions you have.

Yes! that did it. Thanks so much. I installed PYSTRAY 0.17.3 and it runs perfectly <3