caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matt Gushee <mgushee@havenrock.com>
To: caml-list@inria.fr
Subject: LablTk error
Date: Wed, 23 Mar 2005 08:18:58 -0700	[thread overview]
Message-ID: <424188E2.7030309@havenrock.com> (raw)

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


                 reply	other threads:[~2005-03-23 15:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=424188E2.7030309@havenrock.com \
    --to=mgushee@havenrock.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).