From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 20E52BC48 for ; Wed, 23 Mar 2005 16:18:31 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2NFIUJ3024426 for ; Wed, 23 Mar 2005 16:18:30 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA02263 for ; Wed, 23 Mar 2005 16:18:30 +0100 (MET) Received: from mz2.forethought.net (mzpi4.forethought.net [216.241.36.13]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2NFIS5V031208 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Mar 2005 16:18:30 +0100 Received: from [216.241.35.41] (helo=[10.0.0.2]) by mz2.forethought.net with esmtp (Exim 4.30) id 1DE7cp-0004l5-Gn for caml-list@inria.fr; Wed, 23 Mar 2005 08:18:27 -0700 Message-ID: <424188E2.7030309@havenrock.com> Date: Wed, 23 Mar 2005 08:18:58 -0700 From: Matt Gushee User-Agent: Mozilla Thunderbird 1.0 (X11/20050108) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: LablTk error X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 424188C6.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 424188C4.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; labltk:01 widget:01 labltk:01 ocaml:01 widget:01 ocaml:01 otherlibs:01 bool:01 bool:01 patched:01 uncaught:01 unrecognized:01 exception:01 supported:01 int:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Hello, all-- It was brought to my attention the other day that the Tk Text widget now has an undo/redo feature, which is not yet supported by LablTk. Having done this sort of thing before, I thought I'd try to patch the OCaml source code to add the new feature. I added the following to the Text widget section of $OCAML_SRC/otherlibs/labltk/Widgets.src: option AutoSeparators ["-autoseparators"; bool] option MaxUndo ["-maxundo"; int] option Undo ["-undo"; bool] function () edit_modified [widget(text); "edit"; "modified"; \ state: bool] function (bool) edit_modified_get [widget(text); "edit"; "modified"] function () edit_redo [widget(text); "edit"; "redo"] function () edit_reset [widget(text); "edit"; "reset"] function () edit_separator [widget(text); "edit"; "separator"] function () edit_undo [widget(text); "edit"; "undo"] I thought this would be sufficient, since there is no apparent reason to maintain data related to this functionality on the OCaml side. But something is not quite right. After compiling and installing the patched OCaml, I started trying to test the new feature. But the new command Text.edit_modified_get textwin produces Uncaught exception: Invalid_argument("cTKtoCAMLbool") So, to find out what the invalid argument was, I tried a direct command to Tk: tkEval [|tkToken ".t1"; tkToken "edit"; tkToken "modified"|] which resulted in "" The problem is not an incorrect widget name or an unrecognized command: those produce different errors. And the equivalent Tcl command .t1 edit modified works as expected in wish on the same machine. So why would Tk return an empty string? Thanks in advance for any clues to this mystery. -- Matt Gushee Englewood, CO, USA