1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="manual.css">
<TITLE>
The LablTk library: Tcl/Tk GUI interface
</TITLE>
</HEAD>
<BODY >
<A HREF="manual041.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="manual043.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>
<H1 CLASS="chapter"><A NAME="htoc260">Chapter 28</A> The LablTk library: Tcl/Tk GUI interface</H1>
The <TT>labltk</TT> library provides access to the Tcl/Tk GUI from Objective
Caml programs. This interface is generated in an automated way, and
you should refer to Tcl/Tk books and man pages for detailed
information on the behavior of the numerous functions. We also suggest
to use <TT>ocamlbrowser</TT> to see the types of the various functions, that
are the best documentation for the library itself. <BR>
<BR>
<BR>
Programs that use the <TT>labltk</TT> library must be linked as follows:
<PRE>
ocamlc <I>other options</I> -I +labltk labltk.cma <I>other files</I>
ocamlopt <I>other options</I> -I +labltk labltk.cmxa <I>other files</I>
</PRE>
<FONT COLOR=purple>Unix:</FONT>
<BLOCKQUOTE CLASS="quote">
The <TT>labltk</TT> library is available for any system with Tcl/Tk installed,
starting from Tcl 7.5/Tk 4.1 up to Tcl/Tk 8.3. Beware that some beta
versions may have compatibility problems.<BR>
<BR>
If the library was not compiled correctly, try to run again the
<TT>configure</TT> script with the option <TT>-tkdefs</TT> <I>switches</I>,
where <I>switches</I> is a list of C-style inclusion paths leading to
the right <TT>tcl.h</TT> and <TT>tk.h</TT>, for instance
'<TT>-I/usr/local/include/tcl8.3 -I/usr/local/include/tk8.3</TT>'.<BR>
<BR>
A script is installed, to make easier the use of the <TT>labltk</TT>
library as toplevel.
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<TT><B>labltk</B></TT><DD CLASS="dd-description">
This is a toplevel including the <TT>labltk</TT> library, and the path is
already set as to allow the use of the various modules. It also
includes code for the Unix and Str libraries. You can use it
in place of <TT>ocaml</TT>.
</DL>
</BLOCKQUOTE>
<FONT COLOR=purple>Windows:</FONT>
<BLOCKQUOTE CLASS="quote">
The <TT>labltk</TT> library has been precompiled for use with Tcl/Tk 8.3.
You must first have it installed on your system.
It can be downloaded from<BR>
<TT>http://www.scriptics.com/products/tcltk/8.3.html</TT>.
After installing it, you must put the dynamically loaded libraries
<TT>tcl83.dll</TT> and <TT>tk83.dll</TT> (from the <TT>bin</TT> directory of the Tcl
installation) in a directory included in you path.<BR>
<BR>
No toplevel is available, but you can load the library from the
standard toplevel with the following commands.
<BLOCKQUOTE CLASS="quote">
<PRE CLASS="verbatim">
# #directory "+labltk";;
# #load "labltk.cma";;
</PRE></BLOCKQUOTE>
You can also load it directly from the command line.
<BLOCKQUOTE CLASS="quote">
<PRE CLASS="verbatim">
C:\ocaml\bin> ocaml -I +labltk labltk.cma
</PRE></BLOCKQUOTE>
</BLOCKQUOTE>
The <TT>labltk</TT> library is composed of a large number of modules.
<BLOCKQUOTE CLASS="quote">
<PRE CLASS="verbatim">
Bell Imagebitmap Place
Button Imagephoto Radiobutton
Canvas Label Scale
Checkbutton Listbox Scrollbar
Clipboard Menu Selection
Dialog Menubutton Text
Entry Message Tk
Focus Option Tkwait
Frame Optionmenu Toplevel
Grab Pack Winfo
Grid Palette Wm
</PRE></BLOCKQUOTE>
Giving a detailed account of each of these module would be impractical
here. We will just present some of the basic functions in the module
<TT>Tk</TT>. Note that for most other modules information can be found in the
Tcl <TT>man</TT> page of their name.<BR>
<BR>
<a HREF="libref/Tk.html"> The <tt>Tk</tt> library: Basic functions and types for LablTk</a>
<BR>
<BR>
<BR>
<BR>
<HR>
<A HREF="manual041.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="manual043.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
|