\chapter{Introduction} This document provides course-notes and exercises for programming in XPCE/Prolog. Some basic knowledge of Prolog is assumed. XPCE provides the following subsystems. \begin{itemize} \tick{Primitives for building a GUI} Graphical user interfaces are complicated systems. They potentionally consist of a large number of different (visual) entities, possibly with complicated interrelations. XPCE provides high-level building blocks for building dialog windows and interactive graphical representations as well as the dynamics thereof. \tick{The Object System} The object system of XPCE allows the user to create, manipulate, query and destroy objects. XPCE objects represent, in addition to GUI components, various data representation primitives, classes (for defining and extending XPCE) and executable objects for relating GUI components to each other and the application. \tick{The Unix process and filesystem} These building blocks allow the user to communicate to the rest of the computing environment. \tick{Debugging and statistics} Tools allow the user to analyse the GUI as well as tracing the dynamic behaviour of GUI's. \end{itemize} XPCE is both a very large library and a programming environment in its own right. XPCE has similar problems as other big systems such as SmallTalk, CommonLisp, GNU-Emacs and the Unix Tool Kit. All of these environments are hard to master, just because they provide a virtually enless collection of built-in behaviour together with an elegant mechanism to combine behaviour. Novice users have little problems typing `ls' to get a listing of the current directory. Putting all files modified after STAMP onto a tape is harder.% \footnote{{\tt tar cf /dev/rst0 `find . -newer STAMP -type f -print`}} This course only deals with the basic building blocks of the XPCE environment. In addition to the building blocks we will learn the `glue' of XPCE: XPCE's executable objects that allow for elegant connections between GUI components and the application. Handling the manual and debugging tools is another subject in this course. Besides knowing the theory, practice and looking at examples are obligatory ingredients for learning a language. \section{Organisation of the PCE documentation} Currently, the following documents are available for learning XPCE. In addition tothese documents, the demo programs, libraries and the sources of the online manual may be examined as a source of examples. \begin{itemize} \tick{Programming in PCE/Prolog} \cite{PCE:prolog} Explains the basics of programming the PCE/Prolog environment. It should be the first document to read. \tick{PCE-4 Functional Overview \cite{PCE:overview}} This document provides an overview of the functionality provided by PCE. It may be used to find relevant PCE material to satisfy a particular functionality in your program. \tick{PCE-4 User Defined Classes Manual \cite{PCE:udc}} This document describes the definition of PCE classes from Prolog. \tick{PceDraw: An example of using PCE-4 \cite{PCE:draw}} This document contains the annotated sources of the drawing tool PceDraw. It illustrates the (graphical) functionality of PCE. Useful as a source of examples. \tick{The online PCE Reference Manual} The paper documents are intended to provide an overview of the functionality and architecture of PCE. The online manual provides detailed descriptions of classes, methods, etc.\ which may be accessed from various viewpoints. \end{itemize}