29.11.2014 Views

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

29. Using a View Within a Window<br />

29.1 <strong>Introduction</strong><br />

This chapter describes how a custom view c<strong>an</strong> be incorporated into the type of window seen in the last<br />

two chapters. This is import<strong>an</strong>t because although the user interface builder is extremely good at creating<br />

buttons, input/output field style windows, it c<strong>an</strong>not be used to display graphical information. For<br />

example, if you wish to construct a graph of nodes to illustrate a particular route in a path finding<br />

application then this must be generated using the basic MVC (Model-View-Control) features.<br />

In this chapter we consider a simple drawing application which we will call SmallDraw . This<br />

application is illustrated in Figure 29.1.<br />

Figure 29.1: The SmallDraw application<br />

SmallDraw allows boxes, circles <strong><strong>an</strong>d</strong> points to be placed on a scrollable drawing. The three widget<br />

buttons <strong><strong>an</strong>d</strong> the exit button have been defined using the user interface builder. The scrollable drawing<br />

area is a scrollable view which has be created by the user interface builder but which is controller by a<br />

separate model, view <strong><strong>an</strong>d</strong> controller.<br />

In the remainder of this chapter we will consider how this application was constructed.<br />

244

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!