I use the IUP module when the mouse tray processing function is defined according to the standard. But when they compile error, specific code and error are as follows:
proc trayclick(self:PIhandle, button:cint, pressed:cint, dclick:cint) : cint {.cdecl.} =
if button == 1 and pressed == 1 :
setAttribute(self, "HIDETASKBAR", "NO")
elif button == 3 and pressed == 1 :
discard showmenu(self)
return IUP_DEFAULT
Error: conversion from proc (self: PIhandle, button: cint, pressed: cint, dclick: cint): cint{.cdecl, gcsafe, locks: 0.} to Icallback is invalid