Apr-19-2020, 09:26 AM
(This post was last modified: Apr-19-2020, 10:19 AM by steve_shambles.)
I get this error:
File "C:\Python367\lib\site-packages\infi\systray\win32_adapter.py", line 152,
in PackMENUITEMINFO
res.fType = MFT_SEPARATOR
UnboundLocalError: local variable 'res' referenced before assignment
I have tried adding res = 0 at the start of the def and rse.ftype = 0,
same error.
I think I have the +++ code in the correct places according to the diff file.
If I remove them or make a different amount the code runs without error.
Any idea what I have done wrong?
I will look into ndc85430 advice next, but
I haven't a clue how to do that either yet ;-)
Okay I have it working. I 'm not sure what I messed up earlier
but I did it right this time.
Many thanks for your help guys.
So much better.
File "C:\Python367\lib\site-packages\infi\systray\win32_adapter.py", line 152,
in PackMENUITEMINFO
res.fType = MFT_SEPARATOR
UnboundLocalError: local variable 'res' referenced before assignment
I have tried adding res = 0 at the start of the def and rse.ftype = 0,
same error.
I think I have the +++ code in the correct places according to the diff file.
SM_CXSMICON = 49 SM_CYSMICON = 50 COLOR_MENU = 4 DI_NORMAL = 3 MFT_SEPARATOR = 0x00000800 #etc
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 #etc.I only get the error if I have the 5 dashes as a separator "-----".
If I remove them or make a different amount the code runs without error.
Any idea what I have done wrong?
I will look into ndc85430 advice next, but
I haven't a clue how to do that either yet ;-)
Okay I have it working. I 'm not sure what I messed up earlier
but I did it right this time.
Many thanks for your help guys.
So much better.