wxTaskBarIcon problem on macOS

34 views
Skip to first unread message

LIANG ZHOU

unread,
Apr 16, 2024, 8:14:08 AMApr 16
to wx-users
Hello,
My app runs in the background and only has a menu bar icon. For some reason, I don't want to show the menu when right-clicking the mouse. on macOS. both wxEVT_TASKBAR_LEFT_DOWN and wxEVT_TASKBAR_RIGHT_DOWN events are not generated. I cannot check which mouse button is clicked in CreatePopupMenu method. Please help!

Leo

Vadim Zeitlin

unread,
Apr 20, 2024, 7:11:53 PMApr 20
to wx-u...@googlegroups.com
On Tue, 16 Apr 2024 05:14:08 -0700 (PDT) LIANG ZHOU wrote:

LZ> Hello,
LZ> My app runs in the background and only has a menu bar icon. For some
LZ> reason, I don't want to show the menu when right-clicking the mouse. on
LZ> macOS. both wxEVT_TASKBAR_LEFT_DOWN and wxEVT_TASKBAR_RIGHT_DOWN events are
LZ> not generated. I cannot check which mouse button is clicked in
LZ> CreatePopupMenu method. Please help!

AFAICS currently the code initializing the "status item" in
wxTaskBarIconCustomStatusItemImpl::SetIcon() always registers the same
action for both left and right clicks. It should be possible to register
different actions for them and then we could send the LEFT/RIGHT events too
(and still show the menu by default, i.e. if these events are not
processed), but this would require making changes to this code.

If you'd like to submit this as an improvement to wxOSX, please don't
hesitate to do it!

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages