Apr-27-2020, 04:40 AM
(This post was last modified: Apr-27-2020, 04:40 AM by steve_shambles.)
I'm looking into using Pystray because it is cross platform.
I find the docs pretty confusing.
I have the basic system tray up and running with an icon and menu that calls functions.
Now I need separator bars.
Separators are supported but there is no code example anywhere
that I can find.
I think a separator is used like this,but I'm not 100% sure:
The only mention in the docs about separator is:
here
Can anyone point me in right direction please?
I find the docs pretty confusing.
I have the basic system tray up and running with an icon and menu that calls functions.
Now I need separator bars.
Separators are supported but there is no code example anywhere
that I can find.
I think a separator is used like this,but I'm not 100% sure:
from pystray import MenuItem as item import pystray from PIL import Image def action(): pass def exit_prg(): icon.stop() SEPARATOR = item('- - - -', None) image = Image.open("corona.png") menu = (item('Help', action), item('About', action), SEPARATOR(), None) item('Quit', exit_prg) ) icon = pystray.Icon("huh?", image, "Pysystray Demo", menu) icon.run()I get a "unexpected indent" error with this code, now I am totally lost.
The only mention in the docs about separator is:
here
Can anyone point me in right direction please?