10.4. GTK or Photon (in lib/gtk.g, lib/photon.g)

Section 10.4.1, Displaying Text - anygui_show_text
Section 10.4.2, Process Termination - anygui_sigchild
Section 10.4.3, Process Termination - anygui_destroyer
Section 10.4.4, Buttons - .switched_on
Section 10.4.5, Moving the Window - anygui_move_window
Section 10.4.6, Change PID settings in the Monitor - anyos_change_settings
Section 10.4.7, Creating a Message/Dialog Window - anygui_makemsg

10.4.1. Displaying Text - anygui_show_text

The GTK version of this function selects a type font, deletes the existing message from the GtkText widget, and inserts the new text string, using GTK method calls. The Photon version simply uses a method call to insert the new text string.

10.4.2. Process Termination - anygui_sigchild

The difference between these two functions is simply the two different ways to release a toggled button programmatically in GTK and Photon. They both call the child_died function.

10.4.3. Process Termination - anygui_destroyer

10.4.4. Buttons - .switched_on

Several demo functions need to check if a toggle button has been pressed or not. Most of these can be generalized simply by abstracting the check-for-button-pressed part of the code, which is what these methods do.

10.4.5. Moving the Window - anygui_move_window

10.4.6. Change PID settings in the Monitor - anyos_change_settings

This function has been abstracted because of a characteristic in GTK widgets that isn't shared by Photon widgets. When you change a widget in GTK programmatically, such as click a button or move a slider, it automatically invokes any associated callback. The same programmatic change in Photon doesn't invoke a callback.

In addition, the main part of the Photon version of this function has to be abstracted further to handle a discrepancy between Photon 1.14 (QNX 4) and Photon 2 (QNX 6), by making a call to the anyver_change_settings function .

10.4.7. Creating a Message/Dialog Window - anygui_makemsg

This function has been abstracted because message/dialog windows are created differently in GTK than in Photon. GTK uses a GtkDialog widget, which requires a fair amount of setup. Photon's PtMessage widget has more default settings, and thus requires less coding in our case, which is a fairly basic.

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