From: Jim I. <ji...@ap...> - 2002-03-05 22:22:04
|
Jon, Couple of things... First, why won't it load into Aqua Wish? What errors do you get? Second, it is very odd that it receives the event, since there isn't an=20= event loop that is listening to Apple events. I don't really know how=20= Apple Events are delivered in X. I'll ask around... Third, you have to have an App Signature registered with whoever is=20 sending events between Apps (probably the Window Server). Tcl doesn't=20= do that, so it loses (of course Wish does). I wouldn't want to do this=20= by default in Tcl, since that involves linking with alot of the=20 ApplicationServices stack, and this sometimes means you connect to the=20= Window Server on launch, which would be bad. But I bet there is an API=20= to do this, so you could add a command to TclAE to register yourself,=20 and then you would be available for external sends... Jim On Tuesday, March 5, 2002, at 02:01 PM, Jon Guyer wrote: > At 11:31 AM -0800 3/5/02, Jim Ingham wrote: >> Tcl does not support AppleEvents, it doesn't have a Carbon Event >> loop, and is pretty much a straight Unix command-line app. Wish >> responds to the required suite of AppleEvents, plus a "do script" >> Apple Event which holds a string as the direct object. This string >> is just "eval-ed" in the running interpreter. >> >> The do script event is what you want. > > TclAE is another option, giving more access to AppleEvents in all = their=20 > hideous glory, but your Tcl app has to be addressable. Loaded into=20 > Alpha, TclAE responds to AppleEvents just fine. It should work in = Wish,=20 > too, but Aqua Wish 8.4a4 won't load TclAE. I tried an interesting=20 > little experiment though: > > Welcome to Darwin! > [dogbert:~] guyer% tclsh > % package require tclAE > 2.0 > % proc hdlr {args} {puts $args} > % tclAE::installEventHandler FOOO BAAR hdlr > % tclAE::send -s FOOO BAAR ---- 2 > tclAEDesc.1 tclAEDesc.2 > % proc hdlr {evt rpl} {puts [tclAE::print $evt]; puts [tclAE::print=20 > $rpl]} > % tclAE::send -s FOOO BAAR ---- 2 > FOOO\BAAR{'----':2, &addr:psn (=AB0000000000000002=BB)} > 'null'() > > So, tclsh is capable of receiving AppleEvents sent to "self", but I=20 > can't figure out how to target it from another app (Terminal.app isn't=20= > it). > -- > > Jonathan E. Guyer > <http://www.his.com/jguyer/> > > > _______________________________________________ > Tcl-mac mailing list > Tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac > -- Jim Ingham ji...@ap... Developer Tools - gdb Apple Computer |