<!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.06-7 of 2001-11-14"> <TITLE> The LablTk library: Tcl/Tk GUI interface </TITLE> </HEAD> <BODY TEXT=black BGCOLOR=white> <A HREF="manual041.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A> <A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A> <A HREF="manual043.html"><IMG SRC ="next_motif.gif" ALT="Next"></A> <HR> <TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%"> <TR><TD BGCOLOR="#2de52d"><DIV ALIGN=center><TABLE> <TR><TD><A NAME="htoc251"><B><FONT SIZE=6>Chapter 28</FONT></B></A></TD> <TD WIDTH="100%" ALIGN=center><B><FONT SIZE=6>The LablTk library: Tcl/Tk GUI interface</FONT></B></TD> </TR></TABLE></DIV></TD> </TR></TABLE> <BR> 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> 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 COMPACT=compact><DT> <B><TT>labltk</TT></B><DD> 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> 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> <PRE> # #directory "+labltk";; # #load "labltk.cma";; </PRE></BLOCKQUOTE> </BLOCKQUOTE> The <TT>labltk</TT> library is composed of a large number of modules. <BLOCKQUOTE> <PRE> 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="Contents"></A> <A HREF="manual043.html"><IMG SRC ="next_motif.gif" ALT="Next"></A> </BODY> </HTML>