On 08-05-26, at 02:27, Randall Wood wrote:
> Has anyone done any work with using TclLib such that the embedded
> Tcl program is able to return asynchronous notifications to the
> calling program?
> I am embedding Tcl in a Cocoa program and if anyone has any hints
> about this I would greatly appreciate it.
> I had thought of opening a UI channel that listens to output from
> the Tcl code, but would like others comments first.
Not TclLib but options you might want to check out are AppleEvents and
CFNotification centers.
Of these two, the easier route is to use CFNotifications but there are
some limitations WRT to the data types sent (CFPropertyList types
only) if you need to cross certain boundaries. It's not a problem if
you're dealing with text or arbitrary data hunks though. Implement a
broadcaster (CFNotificationCenterPostNotification() or
CFNotificationCenterPostNotificationWithOptions()) command in your Tcl
C code and the observers in the Cocoa app (using CFNotificationCenter
callbacks). From the application observers, reroute the data to
whatever objects that need it. There is the benefit of toll-free-
bridged property list data types.
Philip Aker
echo
astwta@...@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac