Migrating to DeskLib  -  Example applications

by Thomas Down

This item is designed to accompany the article Migrating to DeskLib on page 22 of this month's RISC User magazine. It provides two sample applications, both performing the same function but written using DeskLib and RISC_OSLib respectively in order to illustrate some of the differences.

Running DeskLib from the RISC User menu system, or double-clicking on its icon in a directory viewer, opens a directory containing two further applications: DLibEx and ROLibEx. These look virtually identical, and perform the same function when run: allowing a line of text to be edited in a writable icon, then
providing a save box, allowing the text to be saved either to disc or
to another application.

The only difference between the two applications is that ROLibEx is
written using Acorn's RISC_OSLib, while DLibEx is written with
DeskLib. Both applications include complete source code in their .c
directories. In both cases, the main source module is called
!RunImage. DLibEx also includes three other source code modules:
  
  - Error.c
  - AttachMenu.c
  - SaveBox.c

The first of these is a part of the DeskLib library and should be
linked with all DeskLib programs unless you want to provide your own
error handling routines. The other two make up the DeskLib migration
toolkit mentioned in the article, and may be helpful when converting any RISC_OSLib program to
DeskLib. For information about these files, read the commented headers
in the DLibEx.h directory.

Copyright  RISC User 1994
