Skip to content

Commit

Permalink
labltk -> mltk
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/mltk@4611 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
camlspotter committed Apr 8, 2002
1 parent 1b5457c commit f66811c
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 15 deletions.
2 changes: 1 addition & 1 deletion otherlibs/labltk/Makefile
@@ -1,4 +1,4 @@
# Top Makefile for LablTk
# Top Makefile for mlTk

SUBDIRS=compiler support lib labltk camltk jpf frx tkanim examples_labltk examples_camltk browser

Expand Down
101 changes: 90 additions & 11 deletions otherlibs/labltk/README
@@ -1,25 +1,104 @@
LablTk41 is a library for interfacing Objective Labl with the scripting
language Tcl/Tk (all versions since 7.5/4.1, but no betas).
INTRODUCTION
------------
mlTk is a library for interfacing Objective Caml with the scripting
language Tcl/Tk (all versions since 8.0.3, but no betas).

In addition to the basic interface with Tcl/Tk, this package contains
* the LablBrowser code editor / library browser written by Jacques
* the OCamlBrowser code editor / library browser written by Jacques
Garrigue.
* the "jpf" library, written by Jun P. Furuse; it contains a "file
selector" and "balloon help" support

* the "frx" library, written by Francois Rouaix
* the "tkanim" library, which supports animated gif loading/display

mlTk = CamlTk + LablTk
----------------------
There existed two parallele Tcl/Tk interfaces for O'Caml, CamlTk and LablTk.

CamlTk uses classical features only, therefore it is easy to understand for
the beginners of ML. It makes many converbative O'Caml gurus also happy.
LablTk, on the other hand, uses rather newer features of O'Caml, the labeled
optional arguments and polymorphic variants. Its syntax has much more Tcl/Tk
script flavour, but provides more powerful typing than CamlTk at the same time
(i.e. less run time type checking of widgets).
Until now, these two interfaces have been distributed and maintenanced
independently.

REQUIREMENTS:
mlTk unifies these libraries into one. Since mlTk provides the both API's,
both CamlTk and LablTk users can compile their applications with mlTk,
just with little fixes.

This version is BETA release
----------------------------
This source release is only beta and not well tested in various platforms.
I would be glad if you try to use mlTk to compile your CamlTk/LablTk
applications and report problems at Jun.Furuse@inria.fr, if you have.

REQUIREMENTS
------------
You must have already installed
* Objective Label 2.02 Summer edition
http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/
* Objective Caml source, version 3.04+8 or later

* Tcl7.5/Tk4.1 through Tcl/Tk8.2
* Tcl/Tk 8.0.3 or later
http://www.scriptics.com/ or various mirrors

PLATFORMS:
Essentially any Unix/X Window System platform. We have tested
releases on Linux (ELF x86), FreeBSD (x86), SunOS4.1.x (sparc), DEC
OSF/1 V4.0 (alpha), DGUX SVR4 (m88k). We have not attempted to
compile this package on Windows.
OSF/1 V4.0 (alpha), DGUX SVR4 (m88k) and Windows (VC++ and Cygwin).

INSTALLATION
------------

0. Check-out the O'Caml CVS source code tree.

1. Compile O'Caml (= make world). If you want, also make opt.

2. Untar this mlTk distribution in the otherlibs directory, just like
the labltk source tree.

3. change directory to otherlibs/mltk, and make (and make opt)

4. To install the library, make install (and make installopt)

To compile mlTk, you need the O'Caml source tree, since mltk/camlbrowser
requires some modules of O'Caml. If you are not interested in camlbrowser,
you can compile mlTk without the O'Caml source tree, but you have to modify
support/Makefile.common.


Compile your CamlTk/LablTk applications with mlTk
-------------------------------------------------

* LablTk users

Just change the occurrences of labltk in your Makefiles to mltk
(i.e. -I +labltk => -I +mltk, labltk.cma => mltk.cma, and so on)
Since the API functions are 100% compatible, you need not to change
your .ml files.

* CamlTk users

- Makefiles : apply the same modification explained above for LablTk users.

- open Camltk : The API modules and functions are stored in the modules
Camltk. Therefore you need to replace the module name Tk to Camltk.
For example, open Tk => open Camltk. You may also need to open the Camltk
module explicitly, when your original module source contain no open Tk
phrase.

- Eta expansion to flush optional arguments at registering callbacks.
Functions with _displayof suffix are unified with their non-displayof
versions, using optional labeled arguments. For example, Bell.ring
had/have the following types:

before: Bell.ring : unit -> unit
now: Bell.ring : ?displayof:Camltk.widget -> unit -> unit

If you use these functions as callbacks directly like Command Bell.ring,
you need eta-expansions to flush these new optional arguments:

Button.create w [Command Bell.ring]

=> Button.create w [Command (fun () -> Bell.ring ())]

See the INSTALL file for installation instructions.
2 changes: 1 addition & 1 deletion otherlibs/labltk/lib/.cvsignore
@@ -1,3 +1,3 @@
*.ml *.mli labltktop labltk
*.ml *.mli labltktop labltk mltktop mltk
modules
.depend
2 changes: 1 addition & 1 deletion otherlibs/labltk/support/Makefile.common
Expand Up @@ -4,7 +4,7 @@ TOPDIR=../../..
## Path to the otherlibs subdirectory
OTHERS=../..

LIBNAME=labltk
LIBNAME=mltk

include $(TOPDIR)/config/Makefile

Expand Down
2 changes: 1 addition & 1 deletion otherlibs/labltk/support/Makefile.common.nt
Expand Up @@ -7,7 +7,7 @@ EXEDIR=$(TOPDIRNT)
## Path to the otherlibs subdirectory
OTHERS=../..

LIBNAME=labltk
LIBNAME=mltk

!include $(TOPDIRNT)\config\Makefile.nt

Expand Down

0 comments on commit f66811c

Please sign in to comment.