Name
XtOpenDisplay — open, initialize, and add a display to an application context.
Synopsis
Display ∗XtOpenDisplay(app_context, display_name, application_name, application_class, options, num_options, argc, argv)
XtAppContext app_context;
String display_name;
String application_name;
String application_class;
XrmOptionDescRec ∗options;
Cardinal num_options;
Cardinal ∗argc;
String ∗argv;
Arguments
app_context
Specifies the application context.
display_name
Specifies the display. A display can be in at most one application context.
application_name
Specifies the name of the application instance.
application_class
Specifies the class name of this application, which is usually the generic name for all instances of this application.
optionsSpecifies how to parse the command line for any application-specific resources. The options argument is passed as a parameter to XrmParseCommand. For further information, see XtInitializeDisplay.
num_options
Specifies the number of entries in the options list.
argcSpecifies a pointer to the number of command line parameters.
argvSpecifies the command line parameters.
Description
XtOpenDisplay can be used to open a display (possibly an additional display) and add it to an application context.
The XtOpenDisplay function calls XOpenDisplay with the specified display name. If display_name is NULL, XtOpenDisplay uses the current value of the −display option specified in argv and if no display is specified in argv, uses the user’s default display (on POSIX -based systems, this is the value of the DISPLAY environment variable).
If this succeeds, it then calls XtDisplayInitialize and passes it the opened display and the value of the −name option specified in argv as the application name. If no name option is specified and application_name is non-NULL, then application_name is passed to XtDisplayInitialize. If application_name is NULL and if the environment variable RESOURCE_NAME is set, the value of RESOURCE_NAME is used. Otherwise, the application name is the name used to invoke the program. On implementations that conform to ANSI C Hosted Environment support, the application name will be equal to argv[0] less any directory and file type components; that is, the final component of argv[0], if specified. If argv[0] does not exist or is the empty string, the application name is “main”. XtOpenDisplay returns the newly opened display or NULL if it failed.
XtAppInitialize opens one display. Application contexts are constructed with XtCreateApplicationContext. Parsing the command line is discussed in XtDisplayInitialize(1). There is example code in Chapter 9, Resource Management and Type Conversion, in Volume Four, X Toolkit Intrinsics Programming Manual.