Using ClearWin+ with non-Silverfrost C compilers

ClearWin+ is a library of functions and subroutines that enables developers to produce Windows applications very quickly. It was developed for use with the Salford Fortran compilers, FTN77 and FTN95, and with the Salford C compiler. These compilers are now developed by Silverfrost Ltd. This library is now released in a form suitable for use with other non-Salford compilers, and this manual describes its use with Microsoft and other C/C++ compilers. ClearWin+ has been run under Wine in Linux, so this library could be used there also.

Developing a Windows Graphical User Interface (GUI) tends to be a messy process, which can add disproportionate complexity to small projects. ClearWin+ was designed to reduce GUI programming to an absolute minimum of code. Back in the old days, computer programs performed I/O to a visual display, and/or to files. This was a simple line-by-line process - much simpler than a modern GUI program. Both Fortran and C used (and can still use) formats to control this process. This took a coded string of information to specify numerical layouts, fixed text fields, etc. Without the format concept, programmers would have found themselves overwhelmed by the I/O process even before GUI programming was invented. The idea of ClearWin+ is to enhance format strings to make them so powerful that in addition to their traditional layout functions, they can also specify and control a whole GUI window!

Think for a moment of the C printf function. Its first argument, the format string, contains items like %d - which refers to data in the additional arguments supplied to the function. ClearWin+ uses the same concept, except that because there are so many available codes, each ClearWin+ code is specified by two letters. For example %d becomes %rd or %wd. Two codes are needed because a single window can take data in and also accept data supplied by the user! Most users only use a few of the hundreds of ClearWin+ codes, but the other codes are there to provide a host of other GUI features as required. Of course, a typical window has buttons, type-in text fields and other components that can be used in a more or less arbitrary way. These can generate events that require function arguments - which are invoked in response. However, unlike conventional Windows API programming, ClearWin+ contains lots of default behaviour that vastly simplifies the programmer's task. For example, %rd will automatically check each character is a valid digit or leading sign, and it will update the corresponding variable - so no call back functions calls need be specified for typical simple cases.

The current release can be downloaded here:

Copyright © 1999-2024 Silverfrost Limited