F-Script in a Foundation tool

8 views
Skip to first unread message

Ben

unread,
Nov 4, 2009, 8:16:28 PM11/4/09
to F-Script
Hi all. Sorry for the completely newbie question; I'm just
beginning to get into F-Script. What I'm wondering is, can F-Script
be used from a Foundation tool, or does it necessarily link to AppKit
in a way that messes that up? I don't really understand all the
issues involved, but I gather that Foundation tools should not bring
in AppKit dependencies...?

Ben Haller
Stick Software

Philippe Mougin

unread,
Nov 5, 2009, 7:26:57 AM11/5/09
to F-Script
Hi,

The F-Script framework always links to AppKit. I think this rules out
using it in a Foundation tools (unless you don't mind having AppKit
linked-in, which probably means it is no longer a Foundation tool...)

Philippe

Ken Ferry

unread,
Nov 5, 2009, 4:32:59 PM11/5/09
to f-sc...@googlegroups.com
Usually when someone says "Foundation Tool", they mean that the app doesn't call NSApplicationMain, and possibly doesn't rely on having a connection to the window server.  

I don't think there should be anything that prevents you from using F-Script from that environment.

-Ken

Philippe Mougin

unread,
Nov 5, 2009, 4:56:20 PM11/5/09
to F-Script
Thanks for the clarification. Indeed, I think it should work.

Philippe

Ben Haller

unread,
Nov 10, 2009, 7:09:52 PM11/10/09
to f-sc...@googlegroups.com
On 5-Nov-09, at 4:32 PM, Ken Ferry wrote:

> Usually when someone says "Foundation Tool", they mean that the app
> doesn't call NSApplicationMain, and possibly doesn't rely on having
> a connection to the window server.
>
> I don't think there should be anything that prevents you from using
> F-Script from that environment.

Just for posterity on the list: Ken appears to be correct. I now
have a single app which runs as a GUI Cocoa app if double-clicked, but
runs as a UI-less tool in Terminal if run from there (which it detects
using a command-line flag). To switch between these behaviors, I call
NSApplicationMain() in the GUI case, and do not in the non-GUI case.
My app links against AppKit either way, and that seems to present no
problems whatsoever. I haven't brought in F-Script yet, but given the
situation so far, I don't foresee any problems.
Thanks!

Ben Haller
Stick Software


Reply all
Reply to author
Forward
0 new messages