Quintus Prolog Manual


(PREV) (NEXT)

c-7: Customizing and Interfacing with QUI

The resource file and how it is used in customizing QUI is discussed in {manual(c-7-1)} and {manual(c-7-2)}.

Restrictions on developing programs under QUI are the topic of {manual(c-7-3)}.

c-7-1: The QUI Resource File

By convention, applications developed for the X11 Window System maintain a database of resources. This database is built at run time from application defaults and user preferences.

A resource, in the context of X11, is any customizable data that controls the behaviour and appearance of the application. This includes just about everything: colors, fonts, images, text, titles, sizes, positions, flags, etc.

Quintus ships QUI with a default resource file that defines the "standard" QUI look. This file is located in the directory Quintus-Directory/qui3.3. This file must exist for correct operation of QUI.

We only document some of the resources that QUI uses. The X resource database provides no mechanism for distinguishing between those resources that can be customized and those that can not. Some QUI resources can be customized while modifying others will break QUI. Therefore, if you modify any QUI resource you run the risk of breaking QUI. We suggest that you only change QUI resources for minor enhancements. Quintus reserves the right to change the format and structure of the resource file in future releases.

If you still want to change resources, do not modify the default QUI resource file itself. Rather, create the file (A) that is, a file named Qui3.3 in your home directory, and add the QUI resources you want to modify to it. Alternatively, you can add QUI resources to your existing X defaults file (B).

        $HOME/Qui3.3                                                      (A)

        $HOME/.Xdefaults                                                  (B)



Adding resources to either of these files will override the resources specified in the default QUI resource file.

See your Motif, Xt and Xlib documentation for more information on the X resource database format and use.

c-7-2: Customizing QUI Resources

The easiest way to find the name of the resource you want to change is to look in the default QUI resource file. Once you know the full name of the resource, you can put a line with the same name and a new value in your personal QUI defaults file in your home directory. Note that case is significant in naming a resource and comment lines start with a ! character.

This section offers a few guidelines on how to identify the QUI resources you may wish to customize.

c-7-2-1: Global Resources

c-7-2-2: Labels and Messages

The text that QUI displays in all of its buttons, menus and dialogs can be customized by changing the appropriate resources.

To change a button or menu label, look for the labelString resources. For example:

To change the text of a message, look for the messageString resources. For example:

c-7-2-3: Menu Entries

To customize a QUI menu entry there are potentially four resources that have to be changed. These are:

For example, the "Frame Up" entry in the debugger "Travel" menu is defined by the following resources

c-7-2-4: Key Bindings

All of the QUI text widgets have a set of default key bindings to perform certain operations. These are all translations resources.

The value of a translation resource is a set of lines with an escaped new line character at the end of each line, except the last one. Each line associates a mouse/keyboard event with an internal action. For example

c-7-2-5: Editor Resources

All the QUI editor resources have names that starts with qui*editor. Resources specific to the QUI editor include

Many of the editor text messages have a resource name that ends in Msg, for example

c-7-2-6: Debugger Resources

All the QUI debugger resources have names that start with qui*debugger. Resources specific to the QUI debugger include

c-7-2-7: Help System Resources

All the QUI help system resources have names that start with qui*help_window. Resources specific to the QUI help system include

c-7-3: Restrictions on developing programs under QUI

c-7-3-1: Hook Predicates

message_hook/3: If this predicate is defined in your program, it must be defined as a multifile predicate.

Also, there are restrictions on how you can use message_hook/3 under QUI. In particular, error messages (terms with severity 'error') may not be seen by your message_hook/3 clauses. QUI catches these messages and displays an error dialog.

Since it may be unpredictable whether user-supplied clauses for message_hook/3 come before or after QUI's message_hook/3 clauses, it is also recommended that any message_hook/3 clauses you do supply should fail. See {manual(g-20-3-3)}, as well as the reference page for message_hook/3, for more information.

c-7-3-2: Embeddable C Function

QU_initio(): QUI has already defined this Prolog embedding I/O initialization function. Users' programs linked with QUI cannot redefine the function.

c-7-3-3: Unix Signal Handling

Unix SIGIO signal: This signal is used in QUI. No programs developed under QUI should catch this signal.

Unix SIGPIPE signal: The signal handler of this signal is set to SIG_IGN in QUI. Resetting the signal handler to SIG_DEL may cause QUI to exit unexpectedly.

d: The Emacs Interface


Copyright (C) 1997 AI International Ltd
contact: product support sales information