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

📄 ch36.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 5 页
字号:


</CENTER>



<P>The Goodies option of the Launcher menu provides a pull-right menu of six different



tools that are useful at any time, not just when you program in SmallTalk. The Goodies



are described in Table 36.11. <BR>







<CENTER>



<P><FONT SIZE="4"><B>Table 36.11.</B> The Goodies. </FONT>



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="98" ALIGN="LEFT"><I>Tool</I></TD>



		<TD ALIGN="LEFT"><I>Description</I></TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="98" ALIGN="LEFT" VALIGN="TOP"><TT>Clock</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Displays an analog clock in a square with a toggle for the second hand.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="98" ALIGN="LEFT" VALIGN="TOP"><TT>Round Clock</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Same as the clock but it's round and remains visible when it is minimized.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="98" ALIGN="LEFT" VALIGN="TOP"><TT>Directory View</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Displays a pictorial representation of files and directories. A folder represents



			a directory and a document is a file.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="98" ALIGN="LEFT" VALIGN="TOP"><TT>Mail Tool</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">A tool for managing electronic mail.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="98" ALIGN="LEFT" VALIGN="TOP"><TT>News Tool</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">A repository for news, information, and documents.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="98" ALIGN="LEFT" VALIGN="TOP"><TT>Draw Tool</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">A fairly comprehensive tool for drawing diagrams, charts, pictures, and so on.</TD>



	</TR>



</TABLE>







</CENTER>



<CENTER>



<H3><A NAME="Heading22<FONT COLOR="#000077">The Games &amp; Demos Option</FONT></H3>



</CENTER>



<P>Contained in the pull-right menu of this option are games for your enjoyment and



example applications that may be useful. The Games &amp; Demos option menu is shown



in Figure 36.15. 







<P>



<A HREF="../art/36/36fig15.gif"><B>Figure 36.15.</B> </A> <I>The Games &amp; Demos option



menu.</I>







<P>



<CENTER>



<H3><A NAME="Heading23<FONT COLOR="#000077">Editing in Browsers</FONT></H3>



</CENTER>



<P>All views that show text allow the usual editing functions of that text through



a pop-up menu. The functions available in this menu are described in Table 36.12.



<BR>







<CENTER>



<P><FONT SIZE="4"><B>Table 36.12. </B>Editing functions. </FONT>



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><I>Function</I></TD>



		<TD ALIGN="LEFT" VALIGN="TOP"><I>Description</I></TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>again</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Repeats the last edit.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>copy</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Copies the selected text.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>cut</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Cuts the selected text out of the file.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>paste</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Pastes the text that was copied or cut prior to choosing the paste option to the



			current position of the pointer.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>accept</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Once you have completed editing, you must use this option to save the changes to



			the file; otherwise, the changes will not be written to the file.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>doIt</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Evaluates the highlighted text.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>printIt</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Prints a representation of the result of the evaluation at the current cursor position.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>inspectIt</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Invokes the Inspector view on the result.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>search...</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Enables you to search for a specific string.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>goto...</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Enables you to move to a specific location in the file.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>font...</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Enables you to change the font of the file.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>indent...</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Enables you to change the indenting of the file.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>save as...</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Enables you to save the file under a different name.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>print</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Prints the file.</TD>



	</TR>



</TABLE>







</CENTER>



<P>To select or highlight text, press the left mouse button over the first character



and move the mouse (while pressing the mouse button) to the end of the text you wish



to select and then release the mouse button. If you press the left mouse button again,



the highlighting is removed and you can select something else.</P>



<P>To scroll through the text, use the scroll bars on the left of the view. By clicking



the mouse below or above the thumb, the text scrolls one page for every click. If



you press the Shift key at the same time as you click, the text scrolls to the position



of the pointer in the scroll bar. This is useful for scrolling rapidly through long



documents.



<CENTER>



<H3><A NAME="Heading24<FONT COLOR="#000077">Using the Inspector</FONT></H3>



</CENTER>



<P>The inspector enables you to inspect an object. It consists of two subviews, one



showing the names of the object's instance variables and the other showing the value



of the selected instance variable. You can start an inspector by using the <TT>inspectIt</TT>



function on the edit menu or by sending one of the following messages to an object:<FONT



COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">anObject inspect



</FONT></PRE>



<P>or<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">anObject basicInspect



</FONT></PRE>



<P>The <TT>basicInspect</TT> command will open a general inspector that shows instance



variables as they are physically present in the object. The <TT>inspect</TT> command



is redefined in some classes to open an inspector showing the logical contents of



the object.



<CENTER>



<H3><A NAME="Heading25<FONT COLOR="#000077">Using the Debugger</FONT></H3>



</CENTER>



<P>The debugger is displayed whenever an error occurs in your SmallTalk code. It



shows you where the error occurred and how the system got there. The debugger runs



in one of three modes: <TT>normal</TT>, <TT>modal</TT>, and <TT>inspecting</TT>.</P>



<P>When in normal mode and an error occurs in a process, which is not the event handler



process, the debugger will start up on top of the erroneous process. This blocks



all interaction with the affected process and its views. Other views are still active



and respond as usual.</P>



<P>When an error occurs in the SmallTalk event handler process, the debugger starts



in modal mode. While a modal debugger is active, you cannot interact with any other



view.</P>



<P>The inspecting mode can be entered from the ProcessMonitor by the pop-up menu



and allows inspection of the state of other processes. But since the debugged process



may continue to run, it is only possible to inspect a snapshot of the affected process.</P>



<P>The debugger contains four subviews:







<UL>



	<LI>The Context Walkback List shows the context chain that led to the error.



	<P>



	<LI>The Method Source View shows the method that caused the error.



	<P>



	<LI>The Receiver Inspector allows inspection of the receiver of the selected message.



	<P>



	<LI>The Context Inspector provides information about the arguments and local variables



	of this context.



</UL>







<P>The debugger is shown in Figure 36.16. 







<P>



<A HREF="../art/36/36fig16.gif"><B>Figure 36.16.</B> </a> <I>The debugger. </I>







<BR>



<BR>



The functions that are common to each view appear as a set of buttons below the Context



Walkback List. These functions are described in Table 36.13. <BR>







<CENTER>



<P><FONT SIZE="4"><B>Table 36.13.</B> The debugger function buttons. </FONT>



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><I>Button</I></TD>



		<TD ALIGN="LEFT" VALIGN="TOP"><I>Description</I></TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>continue</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Continues execution</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>terminate</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Terminates the erroneous process</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>abort</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Aborts the current activity if possible</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>step</TT> (single step)</TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Lets the process continue execution until the next <TT>send</TT> is executed in the



			currently selected context</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>send</TT> (single send)</TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Lets the process continue execution for one message send</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>return</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Continues execution as if the selected context returned</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT" VALIGN="TOP"><TT>restart</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Continues execution by restarting the selected context</TD>



	</TR>



</TABLE>







</CENTER>



<P>The Walkback subview has a pop-up menu with the functions described in Table 36.14.



<BR>







<CENTER>



<P><FONT SIZE="4"><B>Table 36.14.</B> Walkback subview pop-up menu function. </FONT>



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="92" ALIGN="LEFT" VALIGN="TOP"><I>Function</I></TD>



		<TD ALIGN="LEFT" VALIGN="TOP"><I>Description</I></TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="92" ALIGN="LEFT" VALIGN="TOP"><TT>exit smalltalk</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Leaves ST/X without saving an image</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="92" ALIGN="LEFT" VALIGN="TOP"><TT>show more</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Shows 50 more contexts of the Walkback</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="92" ALIGN="LEFT" VALIGN="TOP"><TT>breakpoints</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Not yet available</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="92" ALIGN="LEFT" VALIGN="TOP"><TT>trace on/off</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Not yet available</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="92" ALIGN="LEFT" VALIGN="TOP"><TT>trace step</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Not yet available</TD>



	</TR>



</TABLE>







</CENTER>



<P>A minidebugger is entered if an error occurs within the debugger itself. This



is a line-by-line debugger that allows limited debugging without the use of a graphical



user interface. It is controlled by entering commands in the Xterm window where ST/X



was started. If you type <TT>?</TT> at the <TT>miniDebugger</TT> prompt, you will



get a list of commands that are available for use in this stripped-down debugger.



<CENTER>



<H3><A NAME="Heading26<FONT COLOR="#000077">Summary</FONT></H3>



</CENTER>



<P>This chapter introduced you to the SmallTalk environment that is provided by

⌨️ 快捷键说明

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