% % Chapter Getting Started % % Author: Erick Gallesio [eg@kaolin.unice.fr] % Creation date: 4-Nov-1992 15:37 % Last file update: 24-Jul-1996 16:28 \chapter{Getting Started} %\begin{flushright} %{\Huge\bf 1}\\[5mm] %{\Huge\bf Getting Started} %\end{flushright} This chapter will explain the things you must know to begin to manipulate Tk widgets as {\stklos} objects. This is a short introduction for programming the Tk toolkit with objects. If you know how to program it with the Tcl language, you will see that things are not too much different (at least at first sight). A good introduction to Tk programming in Tcl can be found in \cite{Ouster-bok} or \cite{Welch-book}. \section{First steps} When you want to use the Tk toolkit with the {\stklos}, you must first call the {\stk} interpreter. Launching the interpreter is usually done by a call to the shell script {\tt stk} which must have been installed in a standard place. Once, the interpreter is initialized, a small square window will appear on your display. This window is called the {\em root window\index{root window}}. Its value is always retained in the global variable {\tt *top-root*\index{*top-root*}}. Once the Tk initialization is complete, you have to load the file {\tt Tk-classes}. This can be done by \begin{quote} \begin{verbatim} (require "Tk-classes") \end{verbatim} \end{quote} The {\tt Tk-classes} file contains a set of {\tt autoload}s for all the Tk widgets defined in the {\stk} release. If you plan to always work with those classes, you can put this line in your {\stk} init file (i.e. in the file ``{\tt \~/.stkrc}'') to avoid (manual) loading of this file. From now, we are able to interact with the Tk toolkit. Try to enter the following lines at the {\stk} prompt: \begin{quote} \begin{verbatim} (define hello (make