From: Chris Hecker <checker@d6.com>
To: caml-list@inria.fr
Subject: labltk bind ~events list questions/bugs?
Date: Wed, 27 Dec 2000 00:01:11 -0800 [thread overview]
Message-ID: <4.3.2.7.2.20001226234205.00afd710@shell16.ba.best.com> (raw)
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
next reply other threads:[~2000-12-30 21:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-27 8:01 Chris Hecker [this message]
2000-12-31 7:51 ` Jacques Garrigue
2001-01-03 0:07 ` John Max Skaller
2000-12-31 20:25 ` John Max Skaller
2001-01-03 14:29 ` Vladimir Vyskocil
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=4.3.2.7.2.20001226234205.00afd710@shell16.ba.best.com \
--to=checker@d6.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).