Comments (4)
This is currently not supported by "infi.systray", but can be achieved by using MENUITEM.fType = MFT_SEPARATOR
. I currently don't have time to add this feature properly, but here's a quick-and-dirty patch that adds this capability, by setting an item text to 5 hyphens (-----
):
diff --git a/src/infi/systray/win32_adapter.py b/src/infi/systray/win32_adapter.py
index 1b9a9ef..ba4c37e 100755
--- a/src/infi/systray/win32_adapter.py
+++ b/src/infi/systray/win32_adapter.py
@@ -70,6 +70,7 @@ SM_CXSMICON = 49
SM_CYSMICON = 50
COLOR_MENU = 4
DI_NORMAL = 3
+MFT_SEPARATOR = 0x00000800
WPARAM = ctypes.wintypes.WPARAM
LPARAM = ctypes.wintypes.LPARAM
@@ -148,6 +149,9 @@ class NOTIFYICONDATA(ctypes.Structure):
def PackMENUITEMINFO(text=None, hbmpItem=None, wID=None, hSubMenu=None):
res = MENUITEMINFO()
res.cbSize = ctypes.sizeof(res)
+ if text == "-----":
+ res.fType = MFT_SEPARATOR
+ return res
res.fMask = 0
if hbmpItem is not None:
res.fMask |= MIIM_BITMAP
from infi.systray.
I would love to know this too, does anyone know yet?
from infi.systray.
Many thanks wiggin,
but as a comparative noob I can't make head nor tail of that.
I know you are busy so maybe somebody else
can work out how to implement this from the above.
If someone could work this into a def I would be forever in their debt, metaphorically :-)
from infi.systray.
Oky after getting some help from the python forum https://python-forum.io/Thread-Can-anyone-make-sense-of-this?pid=111107#pid111107
I have made the changes and this works beautifully.
Thanks.
screenshot of separator bars:
https://i.postimg.cc/sf5GFdHM/seperators.png
Pastebin of the changed w32_adaptor.py file which can be found
in your python \Lib\site-packages\infi\systray:
from infi.systray.
Related Issues (20)
- ModuleNotFoundError: No module named 'infi.systray' HOT 3
- _load_icon picks wrong resolution HOT 1
- Passing arguments for the function in menu_options. HOT 1
- SysTrayIcon.shutdown produces threading join exception HOT 6
- Icon not loading at windows start HOT 2
- Creating customized menu
- left-click to show the menu HOT 2
- How to add a specific order to tray icons?
- How to update menu options values with systray.update() ?
- How to add text after tray icon.
- Conflict with win10toast HOT 1
- Fonts are blurred when scaling on highDPI monitors HOT 2
- How to add title of menu? HOT 1
- Provide a way to skip adding the default Quit option HOT 2
- Background color changed (feature pls)
- Pop-up bubble/balloon notification (feature request) HOT 1
- systray.shutdown with tkinter doesn't work together HOT 1
- Is there way to remove the Quit command from the systray icon ? HOT 2
- Systrayicon not visible when running the script from windows task schedular. HOT 5
- How to use default Quit option to quit my application instead of quitting only infi.systray? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infi.systray.