Problem with wxMenu on macOS Big Sur 11.3 on M1

79 views
Skip to first unread message

Michael Uman

unread,
May 11, 2021, 8:20:12 PM5/11/21
to wx-users
Hello Group,

This is my 1st post on the group in over 6 years as I have not been working with wxWidgets much. I have been involved with a number of Qt projects in used in IoT devices but have always kept up with what wxWidgets is doing.

So now I am at IBM and working on a project to help us analyze log files generated by one of our AI projects. We are not going to use Qt for this, and in my group we already are using wxWidgets for one of the tools. So I decided to design this new tool with wxWidgets.

My two big projects at a previous employer were the Sigma Designs SMP Debugger and the project named frameInspector (used for analyzing YUV frames from Sigmas video decoder). So I was very proficient at wxWidgets a few years ago.

So I have started this project, logInspector and have been developing it using an Ubuntu 18.04 VM running on one of my powerful laptop systems. The app runs without any problems in that environment. But today I wanted to try to build it on my brand new Apple MacBook Pro 13 M1 system. So I grabbed wxWidgets from the brew repo and my project uses CMake to configure, so it configured fine on macOS Big Sur... The app runs fine except for the following problem.

When the application first runs the Menu is not responsive no matter what. But if I change focus to another window (Alt-Tab) and then back to my app, then the menu works. This happens every time I run my app. I will try with a sample app from the wxWidgets examples, but the code which I am running was generated using wxFormBuilder and it works on Linux. I will also be compiling for Windows shortly.

Thank you to all who have contributed to this project. It feels good to be using wxWidgets again (though I do like Qt a lot).

Thank you,
  Michael Uman
  Sr Software Engineer
  IBM Artificial Intelligence

Igor Korot

unread,
May 12, 2021, 1:25:55 AM5/12/21
to wx-u...@googlegroups.com
Hi,

On Tue, May 11, 2021 at 7:20 PM Michael Uman <muma...@gmail.com> wrote:
>
> Hello Group,
>
> This is my 1st post on the group in over 6 years as I have not been working with wxWidgets much. I have been involved with a number of Qt projects in used in IoT devices but have always kept up with what wxWidgets is doing.
>
> So now I am at IBM and working on a project to help us analyze log files generated by one of our AI projects. We are not going to use Qt for this, and in my group we already are using wxWidgets for one of the tools. So I decided to design this new tool with wxWidgets.
>
> My two big projects at a previous employer were the Sigma Designs SMP Debugger and the project named frameInspector (used for analyzing YUV frames from Sigmas video decoder). So I was very proficient at wxWidgets a few years ago.
>
> So I have started this project, logInspector and have been developing it using an Ubuntu 18.04 VM running on one of my powerful laptop systems. The app runs without any problems in that environment. But today I wanted to try to build it on my brand new Apple MacBook Pro 13 M1 system. So I grabbed wxWidgets from the brew repo and my project uses CMake to configure, so it configured fine on macOS Big Sur... The app runs fine except for the following problem.
>
> When the application first runs the Menu is not responsive no matter what. But if I change focus to another window (Alt-Tab) and then back to my app, then the menu works. This happens every time I run my app. I will try with a sample app from the wxWidgets examples, but the code which I am running was generated using wxFormBuilder and it works on Linux. I will also be compiling for Windows shortly.

Are you creating the Application Bundle?
Or you are just trying to run the binary?

Thank you.

>
> Thank you to all who have contributed to this project. It feels good to be using wxWidgets again (though I do like Qt a lot).
>
> Thank you,
> Michael Uman
> Sr Software Engineer
> IBM Artificial Intelligence
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to wx-users+u...@googlegroups.com
> or visit http://groups.google.com/group/wx-users
> ---
> You received this message because you are subscribed to the Google Groups "wx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/d48e843e-602b-404b-a65d-505500a9ba20n%40googlegroups.com.

Vadim Zeitlin

unread,
May 12, 2021, 6:52:49 AM5/12/21
to wx-u...@googlegroups.com
On Tue, 11 May 2021 17:20:12 -0700 (PDT) Michael Uman wrote:

MU> So now I am at IBM and working on a project to help us analyze log files
MU> generated by one of our AI projects. We are not going to use Qt for this,
MU> and in my group we already are using wxWidgets for one of the tools. So I
MU> decided to design this new tool with wxWidgets.

Excellent decision! :-)

MU> When the application first runs the Menu is not responsive no matter what.
MU> But if I change focus to another window (Alt-Tab) and then back to my app,
MU> then the menu works.

This does look very much like you're running the binary directly, i.e. as
under Linux. This is not supported by Apple and although there are some
hackish ways to make it work, I'd strongly recommend to follow the official
way and create the application bundle and run the application from it
instead.

Note that you can still run the binary from the command line, but you need
to run ./myapp.app/Contents/MacOS/myapp rather than ./myapp directly. You
will also need at least an Info.plist and maybe (I'm not even sure if it's
still required myself) PkgInfo file. You can use samples/Info.plist.in from
wxWidgets as an inspiration for the former.

Good luck!
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

TcT

unread,
May 12, 2021, 6:30:34 PM5/12/21
to wx-users
Note that you can still run the binary from the command line, but you need
to run ./myapp.app/Contents/MacOS/myapp rather than ./myapp directly. You
will also need at least an Info.plist and maybe (I'm not even sure if it's
still required myself) PkgInfo file. You can use samples/Info.plist from
wxWidgets as an inspiration for the former.



As Michael writes he's using CMake for his app, adding  MACOSX_BUNDLE when using add_executable() would be the easiest solution (automatically creates a bundle for you).
Hope this solves the issue easily.

Michael Uman

unread,
May 13, 2021, 12:41:16 PM5/13/21
to wx-users
Thank you for the prompt reply. I will try what TcT suggests, adding MACOSX_BUNDLE... Is this documented anywhere? If so where?

I appreciate the support.

Michael Uman

Tobias Taschner

unread,
May 14, 2021, 3:20:26 PM5/14/21
to wx-u...@googlegroups.com


Michael Uman <muma...@gmail.com> schrieb am Do., 13. Mai 2021, 18:41:
Thank you for the prompt reply. I will try what TcT suggests, adding MACOSX_BUNDLE... Is this documented anywhere? If so where?
If you mean cmake it's just in the docs here:

If you mean the requirement in wxWidgets to use a bundle, I'm not sure.


I appreciate the support.

Michael Uman


On Wednesday, May 12, 2021 at 3:30:34 PM UTC-7 TcT wrote:
Note that you can still run the binary from the command line, but you need
to run ./myapp.app/Contents/MacOS/myapp rather than ./myapp directly. You
will also need at least an Info.plist and maybe (I'm not even sure if it's
still required myself) PkgInfo file. You can use samples/Info.plist from
wxWidgets as an inspiration for the former.



As Michael writes he's using CMake for his app, adding  MACOSX_BUNDLE when using add_executable() would be the easiest solution (automatically creates a bundle for you).
Hope this solves the issue easily.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to wx-users+u...@googlegroups.com
or visit http://groups.google.com/group/wx-users
---
You received this message because you are subscribed to a topic in the Google Groups "wx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wx-users/bIIoFBpfpgk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wx-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/98b5dcf7-0678-4c08-9881-a273bc7a64d1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages