Common Desktop Environment: Application Builder User's Guide

Establishing Application Framework Behavior

Use the Application Framework Editor to specify basic functionality in the application for internationalization, resource file attributes, session management, and ToolTalk message handling. See "To Establish Application Framework Behavior" for instructions.

Graphic
Application Vendor Name

A text field for typing an optional string, which will be stored in the source code. Used in the call to initialize ToolTalk (if ToolTalk is enabled).

Application Version

A text field for typing an optional string, which will be stored in the source code. Used in the call to initialize ToolTalk.

Application Primary Main Window

An option menu for specifying the primary main window of the application being developed. An application may have more than one main window, but only one primary window. This window is typically the window which is first displayed when the application is opened. By default the first main window dropped on the workspace in a new project is the primary window.

Internationalization Enabled

A check box for specifying whether internationalization is enabled; if checked, turns on XPG4-compliant internationalization in the generated code for the project. In the [module]_ui.c file, all labels and strings for objects are generated, enclosed by the catgets(3C) call, which is used to fetch the appropriate localized version of the string at runtime. If internationalization is turned on, dtcodegen will also automatically generate and maintain the message catalog ([project].msg) which maps to the generated catgets(3C) calls.

Generated Code

Check boxes for specifying which categories of object attributes (which map to Xt Resources) should be written into a Resource file instead of placing them directly in the [module]_ui.c file--which is the default. Any attribute (resource) which is specified in a Resource file--and not directly in the code--can be modified without recompiling the application. The Attribute categories are as follows:

Colors: Background, Foreground

Label Strings: Label String, Title

Initial Values: Initial Value

Geometry: X, Y, Width, Height, all attachment attributes

Other Strings

Other

Session Management Method

An option menu for specifying the method of session management (None, Command Line, Session File, or Both), and two push buttons (Session Save Connection, Session Restore Connection) for displaying the Connections Editor and making appropriate connections.

ToolTalk Desktop Message Handling

An option menu for specifying what level of the ToolTalk Desktop Message Alliance protocol the application will participate in, and a push button (Advanced ToolTalk Connections) for displaying the Connections Editor. The ToolTalk desktop protocol is a set of predefined ToolTalk messages which communicate desktop-type events or requests to a running application. App Builder support for ToolTalk is provided at three levels: None, Basic, or Advanced, as described below.

None. There is no participation in the ToolTalk Desktop Protocol; no ToolTalk code is generated.

Basic. The ToolTalk library responds to Desktop messages in categories 1-3 in a predefined and standard way. Code is generated in main() which initializes ToolTalk and calls the function which tells ToolTalk to handles these messages. At this level, you do not need to write any special application code.

Advanced. The ToolTalk library responds to messages in categories 1 and 2, but the application is notified (via callback) when messages in categories 3 & 4 are received.

If you choose Advanced, you must use the Connections Editor to identify which messages the application wishes to handle. If you click the Advanced ToolTalk Connections button, the Connections Editor will be displayed with Application as the Source object type. The When option menu lists four ToolTalk choices: ToolTalk Do Command, ToolTalk Get Status, ToolTalk Pause/Resume, and ToolTalk Quit. The only valid action type for a ToolTalk connection is Call Function; your callback function will be called when the ToolTalk message is received.

At this level code is generated in [project].c:main() which initializes ToolTalk and sets up the Desktop Protocol so that the callbacks defined in the Connections Editor will be called when the corresponding message is received. Each user-defined callback contains descriptive comments describing what the application is expected to do in response to the message. These callbacks are also generated in [project].c.

To Establish Application Framework Behavior

  1. Choose Application Framework from the Editors menu in the App Builder primary window to display the editor.

  2. Type a Vendor Name and Version number in the text fields in the Application section, if appropriate.

    These are used in the call to initialize ToolTalk, if ToolTalk is enabled.

  3. Choose a different primary main window, if appropriate.

  4. Set Internationalization to Enabled, if appropriate.

    Internationalization generates labels and strings for objects with a call that fetches the appropriate localized version of the string at run time. It also generates and maintains a similar message catalog.

  5. Select the attributes you want to be written to the Resource file in the Generated Code section.

    The categories you select are written to a resource file instead of directly to the module file; these attributes, therefore, can be modified without recompiling the application.

  6. Choose a Method (None, Command Line, Session File, or Both) in the Session Management section, as appropriate.

  7. Select Session Save Connection and/or Session Restore Connection, as appropriate, to make connections in the Connections Editor.

  8. Choose a Desktop Message Handling level (None, Basic, or Advanced) in the ToolTalk section, as appropriate.

    See "Establishing Application Framework Behavior" for more about ToolTalk message handling.

  9. If you did not choose Advanced in the previous step, click OK to apply the changes made and dismiss the Application Framework Editor.

  10. Click Advanced ToolTalk Connections if you chose Advanced in the previous step.

  11. Choose the appropriate ToolTalk function from the When menu in the Connections Editor.

  12. Choose Call Function as the Action Type.

  13. Type in the name of the appropriate call function.

    This is the name of the function that will be called when a ToolTalk operation is performed. You will have to edit the stubs.c file to make the called function do something useful. See "Adding User Code to Generated Code" for information.

  14. Click Connect to make the connection.

  15. Click Cancel to dismiss the Connections Editor.

  16. Click OK in the Application Framework Editor to apply the changes and dismiss the editor.