From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA19440 for caml-red; Sat, 30 Dec 2000 22:41:25 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA01081 for ; Fri, 29 Dec 2000 08:51:13 +0100 (MET) Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eBT7pBP12583 for ; Fri, 29 Dec 2000 08:51:12 +0100 (MET) Received: from checkerlap.d6.com ([64.160.55.241]) by mta6.snfc21.pbi.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9) with ESMTP id <0G6B0092BIZ5MO@mta6.snfc21.pbi.net> for caml-list@inria.fr; Thu, 28 Dec 2000 23:18:42 -0800 (PST) Date: Wed, 27 Dec 2000 00:01:11 -0800 From: Chris Hecker Subject: labltk bind ~events list questions/bugs? X-Sender: def6@shell16.ba.best.com To: caml-list@inria.fr Message-id: <4.3.2.7.2.20001226234205.00afd710@shell16.ba.best.com> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Content-type: text/plain; charset="us-ascii" Sender: weis@pauillac.inria.fr Hi, a few labltk questions: 1. Does the ~events list passed to Tk.bind mean the callback should get all of those events? I can't think of what else it's for, but it doesn't seem to work correctly. I only get one of the types, or sometimes none. This is on Win98 with tcl/tk 8.3. Here's some example code: open Tk let _ = let top = openTk () in Wm.title_set top "Simple OCaml Tk App"; Toplevel.configure top ~height:200 ~width:200; print_string "\n"; bind top ~events:[`KeyPress;`ButtonPress] ~fields:[`KeySymString;`Type;`Detail] ~action:(fun ev -> Printf.printf "%s %d %s\n" ev.ev_KeySymString ev.ev_Type ev.ev_Detail ); Printexc.print mainLoop () If I bind the list separately it seems to work, but I haven't tested it thoroughly. 2. As another question, if I have ~events:[`Modified ([`Shift],`KeyPress)], sometimes I just get the keys that were pressed when the shift key was down, sometimes I get a zillion Shift_L events, and sometimes I get nothing. 3. I'd like to be able to distribute an executable compiled with labltk and lablgl without having people have to have tcl/tk installed. Has anybody successfully statically linked tk into an ocaml app? Perl/Tk is set up such that it doesn't depend on the tcl/tk distribution, so I assume this is possible. Would it be a ton of work? Chris