Debian Codegraph @

info/gcl-tk/Getting-Started.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>Getting Started (GCL TK Manual)</title>
7
8 <meta name="description" content="Getting Started (GCL TK Manual)">
9 <meta name="keywords" content="Getting Started (GCL TK Manual)">
10 <meta name="resource-type" content="document">
11 <meta name="distribution" content="global">
12 <meta name="Generator" content="makeinfo">
13 <link href="index.html" rel="start" title="Top">
14 <link href="wm.html#SEC_Contents" rel="contents" title="Table of Contents">
15 <link href="General.html" rel="up" title="General">
16 <link href="Common-Features-of-Widgets.html" rel="next" title="Common Features of Widgets">
17 <link href="Introduction.html" rel="prev" title="Introduction">
18 <style type="text/css">
19 <!--
20 a.summary-letter {text-decoration: none}
21 blockquote.indentedblock {margin-right: 0em}
22 div.display {margin-left: 3.2em}
23 div.example {margin-left: 3.2em}
24 div.lisp {margin-left: 3.2em}
25 kbd {font-style: oblique}
26 pre.display {font-family: inherit}
27 pre.format {font-family: inherit}
28 pre.menu-comment {font-family: serif}
29 pre.menu-preformatted {font-family: serif}
30 span.nolinebreak {white-space: nowrap}
31 span.roman {font-family: initial; font-weight: normal}
32 span.sansserif {font-family: sans-serif; font-weight: normal}
33 ul.no-bullet {list-style: none}
34 -->
35 </style>
36
37
38 </head>
39
40 <body lang="en">
41 <span id="Getting-Started"></span><div class="header">
42 <p>
43 Next: <a href="Common-Features-of-Widgets.html" accesskey="n" rel="next">Common Features of Widgets</a>, Previous: <a href="Introduction.html" accesskey="p" rel="prev">Introduction</a>, Up: <a href="General.html" accesskey="u" rel="up">General</a> &nbsp; [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
44 </div>
45 <hr>
46 <span id="Getting-Started-1"></span><h3 class="section">1.2 Getting Started</h3>
47
48 <p>Once <b>GCL</b> has been properly installed you should be able to do the
49 following simple example:
50 </p>
51 <div class="example">
52 <pre class="example">(in-package &quot;TK&quot;)
53 (tkconnect)
54 (button '.hello :text &quot;Hello World&quot; :command '(print &quot;hi&quot;))
55 ==&gt;.HELLO
56 (pack '.hello)
57 </pre></div>
58 <p>We first switched to the &quot;TK&quot; package, so that functions like button
59 and pack would be found.
60 After doing the tkconnect, a window should appear on your screen, see See <a href="tkconnect.html">tkconnect</a>.
61 The invocation of the function <code>button</code> creates a new function
62 called <code>.hello</code> which is a <i>widget function</i>. It is then
63 made visible in the window by using the <code>pack</code> function.
64 </p>
65 <p>You may now click on the little window, and you should see the command
66 executed in your lisp. Thus &quot;hi&quot; should be printed in the lisp
67 window. This will happen whether or not you have a job running in
68 the lisp, that is lisp will be interrupted and your command will run,
69 and then return the control to your program.
70 </p>
71 <p>The function <code>button</code> is called a widget constructor, and the
72 function <code>.hello</code> is called a widget. If you have managed to
73 accomplish the above, then <b>GCL</b> is probably installed correctly, and you
74 can graduate to the next section! If you dont like reading but prefer
75 to look at demos and code, then you should look in the demos directory,
76 where you will find a number of examples. A monitor for the garbage
77 collector (mkgcmonitor), a demonstration of canvas widgets (mkitems),
78 a sample listbox with scrolling (mklistbox).
79 </p>
80
81
82
83 </body>
84 </html>