App Not Getting Input When Run

From WxWiki
Revision as of 14:22, 28 December 2006 by RyanWilcox (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

When run, your wxMac application doesnt accept mouse or keyboard input.

I'm no Mac developer, I come from wxWin. So I've been searching the Wiki, and asking pretty basic questions on the list.

Today I was stumped. I had a valid executable, but when I ran it, I got a wxMessageDialog I was looking for, but I could not hit the OK button, nor could I bring the window to the front.

A quick question on the list got me this reply:

-= paste =-

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 mv foo

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

-= /paste =-

So, I created the *.app/Contents/MacOS directory, and changed my -o target to that directory. wxMac application now runs fine.

For a Makefile that automates this, see This discussion at the wxWidgets web forum