matthiasm wrote:
>
> On 13.07.2008, at 18:53, Michael Sweet wrote:
>
>> It is trivial to wrap FLTK apps in bundles; perhaps we should make
>> "fltk-config --post foo" create a basic foo.app bundle instead?
>
> Yes, absolutely. --post originally just patched the resource fork into
> telling Finder that this program has no resource fork (talk about dumb
> ideas), but ended up creating a monster of hacks for good startup code
> until 10.5. Now that our code finally breaks (as Apple announced), the
> update of --post is overdue.
>
>> Perhaps
>> we just need to do the equivalent of a dummy Fl_Sys_Menu_Bar to get
>> the menu bar to show for non-bundled apps...
>
> I am pretty sure that that will not work without some hacking. And then
> it still may break in 10.7, etc. .
>
>> Even without the menu bar, applications *do* function properly, they
>> just don't show up in the dock.
>
> Or have a menubar, and who knows what else under the hood.
>
> Doing a bundle is the way that Apple wants it, so I guess we must
> comply. There is still the "open" call to allow opening a bundle from
> the shell. Sigh.
Quick hack:
"makebundle.sh"
#!/bin/sh
#
# Make a bundle from an executable
#
if test $# != 1; then
echo Usage: makebundle.sh filename
exit 1
fi
name="$1"
id=`echo $name | tr ' ' '_'`
# Make the bundle directory and move the executable there
rm -rf "$name.app/Contents/MacOS"
mkdir -p "$name.app/Contents/MacOS"
mv "$name" "$name.app/Contents/MacOS"
# Make a shell script that runs the bundled executable
echo "#!/bin/sh" >"$name"
echo "exec '$name.app/Contents/MacOS/$name'" '$*' >>"$name"
chmod +x "$name"
# Make the simplest Info.plist needed for an application
cat >"$name.app/Contents/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<plist version="0.9">
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleExecutable</key>
<string>$name</string>
<key>CFBundleIdentifier</key>
<string>org.fltk.$id</string>
<key>CFBundleName</key>
<string>$name</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
</dict>
</plist>
EOF
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk