-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add linebreaks in menu? #20
Comments
I would love to know this too, does anyone know yet? |
This is currently not supported by "infi.systray", but can be achieved by using 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 |
Many thanks wiggin, If someone could work this into a def I would be forever in their debt, metaphorically :-) |
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. screenshot of separator bars: Pastebin of the changed w32_adaptor.py file which can be found |
Want to something like this:
But I can only get this:
What should I do?
The text was updated successfully, but these errors were encountered: