Skip to content

Events not passed

Volker Enderlein edited this page Jan 12, 2020 · 2 revisions

You are here: HomeDocumentationMac information pageCoin3D/Mac FAQPotential Errors and Warnings → Events not passed

I cannot interact with my application. Events are not passed on correctly. What's wrong?

Sounds like you are trying to run the plain binary without having it in an application bundle. An application bundle is a hierarchically organized directory that contains the executable plus additional resources, such as images, sounds and so on. Application bundles have the extension .app, and are displayed as double-clickable files in the Finder (i.e. you do not see them as actual directories). In essence, if you have an executable called "foo", a bare-bone application bundle will look like this:

foo.app/
foo.app/Contents
foo.app/Contents/MacOS
foo.app/Contents/MacOS/foo
foo.app/Contents/PkgInfo

For correct event dispatching (among other things), your executable must be part of an app bundle. The easiest way for you to set up that structure is to either use an IDE (Project Builder/Xcode) or the coin-config (or soqt-config) utility to build your program, which create the bundle for you:

$soqt-config --build-app foo foo.cpp

You can create a minimal app bundle manually by setting up the directory structure like this (given an executable foo):

$ ls
bundle.sh foo
$ cat bundle.sh
#!/bin/sh
mkdir $1.app
mkdir $1.app/Contents
mkdir $1.app/Contents/MacOS
mv $1 $1.app/Contents/MacOS
echo "APPL????" > $1.app/Contents/PkgInfo
exit 0

$ ./bundle.sh foo
$ ls
bundle.sh  foo.app
$ open ./foo.app

See the chapter Application Packaging in the Mac OS X System Overview for more information about app bundles.

Clone this wiki locally