Python Forum
Can anyone make sense of this?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can anyone make sense of this?
#1
I am a bit of a fan of the infi-systray module:
https://github.com/Infinidat/infi.systray

I have made 3 simple Windows apps so far.
Heres one of them: https://stevepython.wordpress.com/2020/0...older-sync

One of the downsides with the module is a lack of clear documentation,
not being cross platform, and little things like some of the commands
not working at all as described in the doc, systray.shutdown for example.

One of the more simple things that really need doing is to allow proper separator bars
in the systray menus. At the moment users have to use dashes or underscores, it looks crap.

In the github issues someone asked about this and the author says he has no spare time
to work on it. When I begged he posted this bit of "code" that is tottaly gobbledegook
to me.
https://github.com/Infinidat/infi.systray/issues/20
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
Can anyone sort this into a simple function for me
because I can't and the author has not replied after a week
of me asking him to simplfy it.

I appreciate the author has moved on and is busy. I am not having a dig at him.


Steve.
Reply


Messages In This Thread
Can anyone make sense of this? - by steve_shambles - Apr-19-2020, 05:19 AM
RE: Can anyone make sense of this? - by bowlofred - Apr-19-2020, 05:36 AM
RE: Can anyone make sense of this? - by ndc85430 - Apr-19-2020, 05:59 AM
RE: Can anyone make sense of this? - by buran - Apr-19-2020, 11:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Re writing poste to make sense please help me Nearrivers 10 5,789 Apr-02-2018, 11:52 PM
Last Post: Nearrivers
  These boolean statements don't make sense? Athenaeum 6 5,120 Oct-03-2017, 03:34 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020