#PB_EventType_LeftClick works.
Not sure if it's a PB issue or if Apple changed something for the Status Menu events (SysTray in PB terms).
The code below differs from the original PB example.
Comment/uncomment the desired LeftClick/LeftDoubleClick to test.
Code: Select all
If OpenWindow(0, 100, 150, 300, 100, "PureBasic - Status Menu Example", #PB_Window_SystemMenu)
UsePNGImageDecoder()
IconName1$ = #PB_Compiler_Home + "examples/sources/Data/world.png"
IconName2$ = #PB_Compiler_Home + "examples/sources/Data/ToolBar/find.png"
AddSysTrayIcon(1, WindowID(0), LoadImage(0, IconName1$))
SysTrayIconToolTip(1, "Icon 1")
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_SysTray
; If EventType() = #PB_EventType_LeftClick
; MessageRequester("SysTray", "Left Click on SysTrayIcon "+Str(EventGadget()),0)
If EventType() = #PB_EventType_LeftDoubleClick
MessageRequester("SysTray", "Left DoubleClick on SysTrayIcon "+Str(EventGadget()),0)
ChangeSysTrayIcon (EventGadget(), LoadImage(0, IconName2$))
SysTrayIconToolTip(EventGadget(), "Changed !")
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf