* LablTk error
@ 2005-03-23 15:18 Matt Gushee
0 siblings, 0 replies; only message in thread
From: Matt Gushee @ 2005-03-23 15:18 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-03-23 15:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-23 15:18 LablTk error Matt Gushee
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).