From: Bernard D. <bde...@or...> - 2008-05-27 16:28:03
|
Le 27 mai 08 à 17:48, Bernard Desgraupes a écrit : > > Le 21 mai 08 à 07:33, Joachim Kock a écrit : > >> Until very recently this all worked very well, >> but now for some reason the -c flag seems >> to be broken: try to do >> edit -c [file join $PREFS prefs.tcl] >> twice, and you'll get two windows. >> Cheers, Joachim. > > > I've looked into this and the issue comes from the aeom::handleOpen > OpenDoc handler. In the given case > > tclAE::getKeyData $theAppleEvent NewW > > returns " on" when it should be "no ", i-e this is an endianness > problem. > > Apparently tclAE::getKeyData does the right thing because if I open a > file from the Finder by drag and drop the parameter is correctly read > as "no ": so the error was done when the AE was created in > [editDocument]: > eval [list tclAE::build::resultData -s -dr aevt odoc] $parameters > > Jon, how can we best fix this ? > Here is a suggested fix: I replaced the following line in [editDocument]: lappend parameters NewW no by lappend parameters NewW "type([tclAE::build::TEXT "no "])" The coercion works: when the odoc event is received, the parameter NewW has the right value ('no ' and not " on"). We could wrap this in a proc like proc tclAE::build::type {str} { return "type([tclAE::build::TEXT $str])" } Does this sound right ? Bernard |