At one time, neither of the two standalone applications I have made available from my web site used my Programmer's Toolbox library! Some advertisement, huh?
This page describes how I converted my Dark Light program to use the library.
The first decision to make was which Application Manager to use: asynchronous or synchronous? I decided on the synchronous version for the following reasons:
I started off by constructing a standard main:
procedure,
followed by setting up the required event-handling procedures: keyboard,
foreground, switch-on, and system command.
Version 1.4 of Dark Light was already designed to be event driven, so the existing event handlers were copied straight across. A complication was the handling of the 'disable auto backlight off when external power is available' feature. Version 1.4 checks for external power before handling each event. However, my Application Manager libraries do not allow 'pre-processing' of events, so I moved that code into its own procedure, and called it from the event handlers.
Other fixups included updating the load/save configuration routine to use the Settings I/O module, using the library Find File module, using the Help procedures provided by the Application Managers, and a new Sunrise/Sunset algorithm.
So, what are the costs and benefits of the conversion?
Pros
Cons
During the conversion of my Dark Light program, I uncovered several shortcomings in the Application Manager modules. They are covered on the Changes page.
Download dlconv.zip and compare the source code.