⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 543-547.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Unleashed, Third Edition:Smalltalk/X</TITLE>

<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0672313723//-->

<!--TITLE=Linux Unleashed, Third Edition//-->

<!--AUTHOR=Tim Parker//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Sams//-->

<!--CHAPTER=31//-->

<!--PAGES=543-547//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch30/540-542.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="547-550.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 31<BR>Smalltalk/X

</FONT></H2>

<P><I>by Rick McMullin</I></P>

<DL>

<DT><B>In This Chapter</B>

<DT>&#149;&nbsp;&nbsp; What is Smalltalk/X?

<DT>&#149;&nbsp;&nbsp; How to install Smalltalk/X

<DT>&#149;&nbsp;&nbsp; Invoking Smalltalk/X

<DT>&#149;&nbsp;&nbsp; Getting around in ST/X

<DT>&#149;&nbsp;&nbsp; The Browsers option

<DT>&#149;&nbsp;&nbsp; The Workspace option

<DT>&#149;&nbsp;&nbsp; The File Browser option

<DT>&#149;&nbsp;&nbsp; The Projects option

<DT>&#149;&nbsp;&nbsp; The Utilities option

<DT>&#149;&nbsp;&nbsp; The Goodies option

<DT>&#149;&nbsp;&nbsp; The Games &#38; Demos option

<DT>&#149;&nbsp;&nbsp; Editing in browsers

<DT>&#149;&nbsp;&nbsp; Using the Inspector

<DT>&#149;&nbsp;&nbsp; Using the Debugger

</DL>

<P>This chapter describes the Smalltalk/X (ST/X) application that is included on the Linux CD-ROM. ST/X is a fairly complete implementation of the Smalltalk-80 programming environment. Anyone who has used Smalltalk-80 or any other version of Smalltalk will be impressed with this freely available implementation. This chapter also gives you an overview of the Smalltalk/X application. After reading the chapter you will be familiar with the facilities that Smalltalk/X provides and be able to navigate your way through the Smalltalk/X user interface.

</P>

<H3><A NAME="Heading2"></A><FONT COLOR="#000077">What Is Smalltalk/X?</FONT></H3>

<P>When describing Smalltalk/X, it is probably appropriate to start with a description of Smalltalk itself. Smalltalk is an object-oriented programming language that has been a continuing development project at ParcPlace Systems since the early 1970s. Although it was not the first object-oriented language, it was the first object-oriented language to gain wide use in the industry.

</P>

<P>Smalltalk has been around for about 15 years now, but it was not until recently that it started to become popular. Many universities now teach a Smalltalk course as part of their standard computer science curriculum, and many companies have seen the value that Smalltalk adds in terms of quick development.</P>

<P>Smalltalk/X was developed by Claus Gittinger and was first released in 1988. It is almost identical to the behavior of the Smalltalk 80 implementation of the Smalltalk language. Smalltalk/X comes complete with an application launcher, several different browsers for browsing through the Smalltalk class hierarchy, and a very powerful debugging utility. The unique aspect of Smalltalk/X is that it can also behave as a Smalltalk-to-C translation utility. This is a very useful feature because this means that you are able to combine the speed of development that Smalltalk provides with the speed of execution that C provides.</P>

<H3><A NAME="Heading3"></A><FONT COLOR="#000077">How to Install Smalltalk/X</FONT></H3>

<P>Although Smalltalk/X is on the Linux CD-ROM that comes with this book, it is not installed as part of the default install scripts. The Smalltalk/X files can be found in the <TT>devel/smalltalkx</TT> directory on the CD-ROM. To install Smalltalk/X, perform the following steps as <TT>root</TT>.</P>

<DL>

<DD><B>1.</B>&nbsp;&nbsp;Create a directory called <TT>/usr/local/lib/smalltalk</TT>.

<DD><B>2.</B>&nbsp;&nbsp;Copy the following files into the <TT>/usr/local/lib/smalltalk</TT> directory.

<!-- CODE SNIP //-->

<PRE>

bitmaps.tar.Z

doc.tar.Z

exe.tar.Z

goodies.tar.Z

source.tar.Z

</PRE>

<!-- END CODE SNIP //-->

<DD><B>3.</B>&nbsp;&nbsp;Uncompress and un<TT>tar</TT> these files by entering the following commands:

<!-- CODE SNIP //-->

<PRE>

uncompress *.Z

tar -xf bitmaps.tar

tar -xf doc.tar

tar -xf exe.tar

tar -xf goodies.tar

tar -xf source.tar

</PRE>

<!-- END CODE SNIP //-->

<DD><B>4.</B>&nbsp;&nbsp;You can now delete all of the <TT>tar</TT> files by entering the following command:

<!-- CODE SNIP //-->

<PRE>

rm *.tar

</PRE>

<!-- END CODE SNIP //-->

</DL>

<P>The Smalltalk/X program should now be installed and ready to go. If you do not have write access to the <TT>/usr/local/lib</TT> directory, you can install Smalltalk/X in some other directory by following the same steps listed above. If you do this, you must set the <TT>SMALLTALK_LIBDIR</TT> variable to be equal to the new directory.</P>

<H3><A NAME="Heading4"></A><FONT COLOR="#000077">Invoking Smalltalk/X</FONT></H3>

<P>You invoke Smalltalk/X by typing

</P>

<!-- CODE SNIP //-->

<PRE>

smalltalk

</PRE>

<!-- END CODE SNIP //-->

<P>in an Xterm window. When ST/X starts, it checks to see if there is an image file for it to use. If it cannot find an image file, it uses a file called <TT>smalltalk.rc</TT> to set up the default behavior for your environment. The image file that is loaded by default is called <TT>st.img</TT> and contains a snapshot of what your ST/X environment looked like the last time you exited. This allows you to resume exactly where you left off. You can save a snapshot under any name with the extension <TT>.img</TT>. To invoke ST/X with an image other than <TT>st.img</TT>, enter the following command at the prompt:</P>

<!-- CODE SNIP //-->

<PRE>

smalltalk -i nameofImage.img

</PRE>

<!-- END CODE SNIP //-->

<H3><A NAME="Heading5"></A><FONT COLOR="#000077">Getting Around in ST/X</FONT></H3>

<P>Once ST/X is invoked, two windows or views appear. The Transcript view and the Launcher menu. The Transcript view is shown in Figure 31.1.

</P>

<P><A NAME="Fig1"></A><A HREF="javascript:displayWindow('images/31-01.jpg',500,157 )"><IMG SRC="images/31-01t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/31-01.jpg',500,157)"><FONT COLOR="#000077"><B>Figure 31.1.</B></FONT></A>&nbsp;&nbsp;The Transcript view.</P>

<P>The Transcript is the console where relevant systems information is shown. The Launcher menu is shown in Figure 31.2.

</P>

<P><A NAME="Fig2"></A><A HREF="javascript:displayWindow('images/31-02.jpg',131,255 )"><IMG SRC="images/31-02t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/31-02.jpg',131,255)"><FONT COLOR="#000077"><B>Figure 31.2.</B></FONT></A>&nbsp;&nbsp;The Launcher menu.</P>

<P>The Launcher allows access to the tools you will need to program your application. Table 31.1 gives the options available from the Launcher and a brief description of each.

</P>

<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 31.1.</B> The Launcher menu options.

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TH WIDTH="30%" ALIGN="LEFT">Option

<TH WIDTH="70%" ALIGN="LEFT">Description

<TR>

<TD COLSPAN="2"><HR>

<TR>

<TD VALIGN="TOP">Browsers

<TD>The pull-right menu of this option gives you access to browsers, senders, and implementors.

<TR>

<TD>Workspace

<TD>This option brings up a workspace view.

<TR>

<TD VALIGN="TOP">FileBrowser

<TD>This browser allows inspection and manipulation of files and directories.

<TR>

<TD VALIGN="TOP">Projects

<TD>This option allows you to choose an existing or new project.

<TR>

<TD VALIGN="TOP">Utilities

<TD>This contains tools specific to your programming needs.

<TR>

<TD>Goodies

<TD>This contains other non-programming related tools.

<TR>

<TD VALIGN="TOP">Games &#38; Demos

<TD>This contains some sample programs and games to play.

<TR>

<TD VALIGN="TOP">Info &#38; Help

<TD>This contains topics that give you help and information on the ST/X environment and programming in Smalltalk.

<TR>

<TD VALIGN="TOP">Snapshot

<TD>This option takes a snapshot of your present ST/X environment and asks for the name of the image file you wish to store the snapshot in.

<TR>

<TD VALIGN="TOP">Exit

<TD>This option allows you to exit ST/X immediately, or exit and save a snapshot of the current environment.

<TR>

<TD COLSPAN="2"><HR>

</TABLE>

<P>The following sections describe most of these options in more detail.

</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch30/540-542.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="547-550.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -