Using ANSI C (Part 5)
by Lee Calcraft

This is an example of a Wimp application written in C. When run, the program adds an icon to the icon bar. Clicking Select on this icon causes a beep to be generated. Clicking Menu over the icon displays a menu containing the usual Info and Quit options, plus a Test option.

The Test option leads to a submenu containing three entries. Choosing Test1 causes a tick to be toggled on and off. Choosing Test2 has no effect. The third entry, Search, leads to a dialogue box containing a writable icon, an option (on/off) icon entitled 'Case sens', an action icon entitled 'OK', and an icon entitled 'Previous' (which is this month's addition).

As with all dialogue boxes created using the dbox library, the function keys activate icons in order, so pressing F1 activates the 'OK' icon, F2 toggles the 'Case sens' icon on and off, and F3 activates the 'Previous' icon. Also pressing Return while the caret is in the last writable icon (in this case the only one), activates icon 0, i.e. the 'OK' icon.

The application's source code is saved as !C_Demo.C_Source.
