Search code examples
macoswxwidgets

Help! My wxMac app does not accept mouse or keyboard input


I have followed the wxWidgets "hello world" tutorial here: http://www.wxwidgets.org/docs/tutorials/hello.htm

Everything seems fine, the program compiles and starts, but the app is totally unresponsive. I can't click the window to front or move it. What could be wrong?

I am using wxMac on Snow Leopard.


Solution

  • You must create a bundle for Carbon and Cocoa apps on OS X.

    If your binary is named "foo" then this works for testing purposes (don't ship like this):

     mkdir -p foo.app/Contents/MacOS
     mv foo foo.app/Contents/MacOS
    

    When you get things working you can eventually tweak your build system to make the bundle before the final link step and pass -o foo.app/Contents/MacOS/foo to the linker rather than plain -o foo.

    For a Makefile that automates this, see the wxWidgets web forum.