-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added wxTaskBarIcon:new/1 to create popupmenu #2743
Conversation
Thanks for the PR, I'm in the process of rewriting the code generator for wx (base it of interface files in 3.1) instead of "real" headers, so I will let this wait a while. |
That's great to hear! Would be awesome to have the constants be defined (or at least accessible) through a function, so they become accessible to other beam languages (Elixir in my case) |
Also another thing that I realized is that virtual impl callbacks like this one can create deadlocks when creating new wx objects. Not sure if that is fixable in your effort. |
I'll keep that in mind then, didn't know that you couldn't.
Can you email me, dgud at erlang org, a short example or an explanation. |
@dgud sorry didn't have time yet to reproduce the menu issue, hopefully will do that later. Regarding your rewrite of the generator, when do you expect that to go into otp? IMHO the current situation is rather buggy since macos is now the only OS you can't use the taskbaricon on. If your rewrite is longer term I would opt to include this as a bugfix until then. Even though the bug is in wx, for people trying to port their apps from windows or linux to macos it's a showstopper right now :-( Would also be happy to make any changes to the calling interface for injecting the fun if that helps making the current solution more forward compatible. |
Ok, will take a better look at this for OTP-23.2 then. The rewrite targets OTP-24 as it will be backwards incompatible in a couple (many) hopefully not used functions. |
Can you rebase this on maint, since we want to release this in the next maint release. Also do we need a new example can it not be added to the existing menu example? |
Sure, can merge the examples and rebase |
704e795
to
7289f31
Compare
here you go @dgud |
With the new cocoa based wxWidgets backend for macos call PopupMenu( menu ) to create a taskicon menu is officially not supported anymore for mac. Thus the only way to create a popup menu is to provide an override for the "wxMenu* CreatePopupMenu()" virtual function.
This patch adds the ability to provide a callback function in the constructor which then servers as CreatePopupMenu() implementation.
I've also supplied a small taskbar sample app, to exemplify the usage.