Three-dimensional shadows

It is possible to give shadows to VBT's to give them a three-dimensional appearance. This requires the modules Shadow and ShadowVBT from VBTKit. VBTKit is an additional collection of modules and a library built on top of Trestle.

The program Main.m3 illustrates the different kinds of shadows in VBTKit. Each kind of shadow gives a different three-dimensional appearance to the associated VBT. There are five different styles of shadows: flat, raised, lowered, ridged and chiseled. A shadow object (a value of type Shadow.T), however, is just a size and some colors.

Shadow.New (
    size := 7.0,       (* width of shadow around VBT in points   *)
    bg := grey,        (* color of background for flat style     *)
    light := lgrey,    (* one color of the shadow                *)
    dark := dgrey      (* another color of the shadow            *)
);
These values are used to control the size and the color of the shadow.

The program Main.m3 creates a button in each of the five styles. The shadowed VBT takes a Shadow.T as an argument. The images

show two views of the application. When a button is depressed the text changes, but not the shadow. To change the appearance of the shadow in response to actions by the user a new kind of VBT is required called a feedback. These are illustrated in the next section Feedback for buttons.