Photon Functions (in phsimple.g)

Cogent Tools Demo and Tutorials: Version 4.0
Prev |  | Next

# Chapter 8. Photon Functions (in `phsimple.g`)

This code was written to run interchangeably on two operating systems (QNX 4 and QNX 6), each with its own respective version of Photon (1.14 and 2). Thus you will find in several places some `if` statements and/or variations in the code to allow for small differences in QNX and Photon versions. This problem is solved in a more complete way in Tutorial Two, where we use common and abstracted functions to incorporate Linux and GTK as well as QNX 4, QNX 6, and Photon into a truly cross-platform application.

This chapter presents the code for `phsimple.g` in several annotated sections. The program functions are arranged slightly out of order in this chapter, not exactly as they appear in the actual program. The complete program in proper sequence is shown in the final section of this chapter.

# 8.1. Required Libraries and Initializing Photon

To use Photon in Gamma we need a few extra libraries. The Gamma wrappers for Photon widgets are in `PhotonWidgets.lsp`, and there are functions that help us interface with PhAB in the `PhabTemplate.lsp` file. These are called in using the Gamma `require_lisp` function, because they are written in Lisp. We also have to initiate a graphics session with the Photon Window Manager, using the Gamma function `PtInit`.

       /********************************************************
        *                     STARTING UP                      *
        ********************************************************/

       require_lisp("PhotonWidgets.lsp");
       require_lisp("PhabTemplate.lsp");
       PtInit(nil);

Prev | Home | Next
Complete program - `gtksimple.g` | Up | The Monitor Window - `create_monitor`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.