between the video hardware and the rest of the PEG library, which is required to insure
that PEG is easily portable to any target environment.
The PegThing
The most important and fundamental class in the PEG library is the PegThing. PegThing
is the base class from which all viewable PEG objects are derived. While you may never
create an instance of an actual PegThing in your application, it is very possible that you
will derive your own custom control types from PegThing. In any event, every window
and control you will use is based on PegThing, so you will be using the public functions
of PegThing often when programming with PEG.
Because of the importance of these public functions, we will go though most of them in
this section. We will also provide brief explanations of how and when to use the function.
Traversing the Presentation Tree of PegThings
When you add a new PegThing to the PegPresentationManager, you begin creating a tree
of all viewable objects. As more objects are added, the tree begins to take shape with
relationships of parent, child and siblings. Take this possible example:
PegPresentation
Manager
PegWindow2
PegWindow1
PegPrompt1 PegPrompt2 PegCheckBox
PegButton
If we take the role of PegWindow1, our parent would be PegPresentationManager, our
sibling would be PegWindow2 and our children would be PegPrompt1, PegPrompt2 and
PegButton.
Given this arrangement of PegThings, you could expect an arrangement something like
the following to be drawn to the screen:
8