<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ --> <head> <title>GCL TK Manual: Getting Started</title> <meta name="description" content="GCL TK Manual: Getting Started"> <meta name="keywords" content="GCL TK Manual: Getting Started"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="index.html#Top" rel="start" title="Top"> <link href="wm.html#SEC_Contents" rel="contents" title="Table of Contents"> <link href="General.html#General" rel="up" title="General"> <link href="Common-Features-of-Widgets.html#Common-Features-of-Widgets" rel="next" title="Common Features of Widgets"> <link href="Introduction.html#Introduction" rel="prev" title="Introduction"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} blockquote.smallquotation {font-size: smaller} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} div.indentedblock {margin-left: 3.2em} div.lisp {margin-left: 3.2em} div.smalldisplay {margin-left: 3.2em} div.smallexample {margin-left: 3.2em} div.smallindentedblock {margin-left: 3.2em; font-size: smaller} div.smalllisp {margin-left: 3.2em} kbd {font-style:oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} span.nocodebreak {white-space:nowrap} span.nolinebreak {white-space:nowrap} span.roman {font-family:serif; font-weight:normal} span.sansserif {font-family:sans-serif; font-weight:normal} ul.no-bullet {list-style: none} --> </style> </head> <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> <a name="Getting-Started"></a> <div class="header"> <p> Next: <a href="Common-Features-of-Widgets.html#Common-Features-of-Widgets" accesskey="n" rel="next">Common Features of Widgets</a>, Previous: <a href="Introduction.html#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="General.html#General" accesskey="u" rel="up">General</a> [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> </div> <hr> <a name="Getting-Started-1"></a> <h3 class="section">1.2 Getting Started</h3> <p>Once <b>GCL</b> has been properly installed you should be able to do the following simple example: </p> <div class="example"> <pre class="example">(in-package "TK") (tkconnect) (button '.hello :text "Hello World" :command '(print "hi")) ==>.HELLO (pack '.hello) </pre></div> <p>We first switched to the "TK" package, so that functions like button and pack would be found. After doing the tkconnect, a window should appear on your screen, see See <a href="tkconnect.html#tkconnect">tkconnect</a>. The invocation of the function <code>button</code> creates a new function called <code>.hello</code> which is a <i>widget function</i>. It is then made visible in the window by using the <code>pack</code> function. </p> <p>You may now click on the little window, and you should see the command executed in your lisp. Thus "hi" should be printed in the lisp window. This will happen whether or not you have a job running in the lisp, that is lisp will be interrupted and your command will run, and then return the control to your program. </p> <p>The function <code>button</code> is called a widget constructor, and the function <code>.hello</code> is called a widget. If you have managed to accomplish the above, then <b>GCL</b> is probably installed correctly, and you can graduate to the next section! If you dont like reading but prefer to look at demos and code, then you should look in the demos directory, where you will find a number of examples. A monitor for the garbage collector (mkgcmonitor), a demonstration of canvas widgets (mkitems), a sample listbox with scrolling (mklistbox). </p> </body> </html>