• Aucun résultat trouvé

System Transcript) 1981, 1988 ParcPlace Systems, Inc

Dans le document til Smalltalk (Page 85-88)

System Workspace

The Sm a.llt a.lk - 8Otm System Version 2.3

System Transcript)

1981, 1988 ParcPlace Systems, Inc.

Hello world.

~

,

, :~:~;~~,:i:~~~:;.nd ever \ i

System Browser

, :;~~~:=~~:~~t :~i!i~C::::=::::::

A

:.;.;...::·.:...

:::j.:.••.

,.::r.:~

..*.:I".

.; fR'erriel::.·Cil:i·e'Cts...·1 ~

: ,···...~..·....···..·..·'I'1![I~rl~st~a~nc~e!!1l1 ~~

Figure 3.1 Typical Smalltalk display.

2 A. Goldberg and D. Robson. SmaJ/lalk-80: The Language and Its Implementation (Reading, Mass.:

Addison-Wesley. 1984).

Chapter 3 An Introduction to the Smalltalk User Interface 69

Selection

This lack of a standard hardware configuration will not concern us unduly. In this chapter, we are more concerned with the small number of functions and tasks we need to perform than the particular screen resolution or type of pointing device that is available. For example, selecting an object from the screen can be achieved in many ways, but all selections involve two basic activities: pointing at the object we want to select and confirming the selection. In Smalltalk and most other systems, pointing is achieved by moving a graphical cursor on the display screen. In one system, this might be achieved by attaching the movement of the cursor to the movement of a mouse or joystick. In another, the cursor might be controlled using special keyboard function keys to incrementally move the cursor up, down, right, and left. Confirming the selection might be done by depressing a mouse button or, alternatively, a keyboard function key.

Consult the documentation provided with your system to find out how to achieve each of the tasks we describe in this chapter. Most of the chapter is independent of hardware considerations. Since a mouse is by far the most commonly available pointing device on systems supporting Smalltalk, we will describe activities in terms of mouse interactions.

Readers who are familiar with mouse-based interactive systems may wish to skip the next section.

3.1.5 Pointing Device Mechanics

Two fundamental interaction sequences,selectionandextended selection,are carried out with the pointing device when interacting with the Smalltalk system.

Used to indicate a position on the Smalltalk display screen; e.g., to indicate where text, when typed from the keyboard, should be inserted. Two activities are involved in making a selection: (1) moving the cursor on the screen to the desired position, and (2) confirming the position you have selectedtothe Smalltalk system.

With a mouse, selection can be achieved by moving it to position the cursor at the desired point, and confirmation can be achieved by single clicking (briefly pressing and releasing) a mouse button.

Extended Selection A two part selection process that delimits a region of the screen; e.g., to select a section of text, we need to select both the start and end points of the text. Similarly, to size and position a rectangle on the screen, we need to select two opposite comers of the rectangle.

With a mouse, extended selection is achieved in the following manner. Position the cursor with the mouse to indicate a start position, depress (but do not release) a mouse button to begin the selection, drag (move with the mouse button still depressed) the mouse to a final position, and finally release the button to confirm the final selection. Visual feedback is always provided during the dragging operation. For example, when selecting text, the currently selected text is complemented (white characters on a black background) on the display.

111111 I

We will see many further examples of selection and extended selection. Find out, by consulting your system documentation, how selection and extended selection operations can be performed in your Smalltalk system. You may find that extended selection operations can be performed in more than one way.

3.2 GElTING STARTED

3.2.1 Activating Smalltalk

Consult your system documentation for specific instructions on creating and activating your Smalltalk system.

Activate your Smalltalk system.

Once activated, the display screen will be similartothat shown in Fig. 3.1. Smalltalk is now ready for use.

A typical Smalltalk display has several windows displayed over a dark background.

Each window consists of a framed rectangular area with a small title or label in its top left-hand corner. Windows may overlap each other and can be simplistically thought of as overlapping pieces of paper resting on a desktop. Strictly speaking, Smalltalk uses the term view for window. We will use the more familiar window terminology. Fig. 3.2 shows four of the most common types of windows: Workspace, System Workspace, System Browser and System Transcript windows. The most common uses for each of these windows are the following:

Workspace A window used as a scratchpad area where fragments of Smalltalk code can be entered, stored, edited, and evaluated.

System Workspace A special workspace window that acts as a repository for Smalltalk expressions (or expression templates) for performing common Smalltalk tasks. These expressions can be easily selected, modified, and evaluated by the programmer. The System Workspace window avoids the need to remember and retype often used expressions.

System Browser A window in which most programming activities are carried out. The Smalltalk class library can be viewed, existing classes modified, and new classes added.

System Transcript A window primarily used by the Smalltalk system and by programmers as a notice board on which to display error information or messages describing the progress of a Smalltalk activity.

A unique feature of the Smalltalk environment is the ability to work on a series of tasks in parallel and to move back and forth between these tasks without loss of context or information. Each task (or conversation) is carried out within its own window. Though many windows (tasks) may be visible on the desktop at any time, only one window (task) is Chapter 3 An Introduction to the Smalltalk User Interface 71

active at any given moment. This window, known as the active window, will have its label tag highlighted (inverted). For example, in Fig. 3.1, the Workspace window is active.

3.2.2 Changing the Active Window

To change the active window, perform a selection operation with the mouse. Move the cursor into the window to be activated and confirm the selection; Le., click the red mouse button - see the next section for a discussion of mouse button terminology. The activated window will be brought to the "top" of the desktop and have its label inverted. In Fig. 3.2, the System Browser window has been made active. This technique canbeused to interrupt one conversation, commence another, interrupt it, restart the original and so on. The saving and restoring of the state of each conversation is handled automatically by the Smalltalk system.

notNil sterns, Inc.

testing

Init ial ize- r elea s accessing Model

TrlJe

t:'::===wr---I corn paring

IIiiiIiIJ

cl.ass

Dans le document til Smalltalk (Page 85-88)