caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* CSL-1.12 and CamlTK4, text tag problem
@ 1995-12-04 19:40 Mark C. Chu-Carroll
  0 siblings, 0 replies; only message in thread
From: Mark C. Chu-Carroll @ 1995-12-04 19:40 UTC (permalink / raw)
  To: caml-list



Greetings!

I'm working on a TK based text editor/user environment loosely based on
Rob Pike's Acme for Plan9. For some details of how some of the more advanced
features are going to work, CSLs functors are probably going to turn out to
be extremely useful. So when CSL-1.11 came out, I eagerly grabbed it, and
compiled it with Camltk4 libraries that came with the MMM source distribution.

It seems to be working pretty well, with one minor (frustrating) exception.
One very important feature of Acme is the sweeping of text with the middle
and right mouse buttons. To do this, I have an action associated with
mouse motion events which inserts the swept text into a tag, and then
tries to highlight the tag. 

After a lot of hacking, what I seem to have found is that tags are not
being created correctly by Text.tag_add. The following code fragment
demonstrates the problem:

   Text.tag_add textwin "command" t1 t2;
   let str = Text.get textwin (TextIndex(TagFirst("command"), [])) 
                              (TextIndex(TagLast("command"), []))
   in print_string str

In this fragment, "textwin" is a text window, and t1 and t2 are valid
text indices. The indices are definitely not a problem; "Text.get
textwin t1 t2" works correctly. But when the above code fragment is
run, it produces "Fatal error: uncaught exception TkError". 

"Text.tag_allnames textwin" returns a list containing the "command" tag,
so the tag is being created somehow. But any attempt to try to access
the tag, or to use any index created from the tag, causes an 
exception.

I took a quick look at the CamlTK4 source to see if I could figure out
the problem. Unfortunately, I haven't been able to find anything
obvious, and I won't have the time to figure it out for a while. Can
anyone give me a clue of how to get this to work? I'd really hate to
have to migrate back to itcl!

	<MC>





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-12-05  8:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-12-04 19:40 CSL-1.12 and CamlTK4, text tag problem Mark C. Chu-Carroll

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).