Name
XtDisplayInitialize — initialize a display and add it to an application context.
Synopsis
void XtDisplayInitialize(app_context, display, application_name, application_class, options, num_options, argc, argv)
XtAppContext app_context;
Display ∗display;
String application_name;
String application_class;
XrmOptionDescRec ∗options;
Cardinal num_options;
Cardinal ∗argc;
String ∗argv;
Arguments
app_context
Specifies the application context.
displaySpecifies the display. Note that 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. This name 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.
num_options
Specifies the number of entries in the options list.
argcSpecifies a pointer to the number of command line arguments.
argvSpecifies the command line arguments.
Description
XtDisplayInitialize builds the resource database, parses the command line using the Xlib XrmParseCommand function, and performs other per-display initialization. It does not actually open a display connection. Most programs should use XtOpenDisplay instead.
After XrmParseCommand has been called, argc and argv contain only those arguments that were not in the standard option table or in the table specified by the options argument. If the modified argc is not zero, most applications simply print out the modified argv along with a message listing the allowable options. On POSIX-based systems, the application name is usually the final component of argv[0]. If the synchronize resource is True for the specified application, XtDisplayInitialize calls the Xlib XSynchronize function to put Xlib into synchronous mode for this display connection. If the reverseVideo resource is True, the Intrinsics exchange XtDefaultForeground and XtDefaultBackground for widgets created on this display.
This function is not often used unless you are creating multiple application contexts, since XtAppInitialize provides a simplified interface to it (and the other two Toolkit initialize functions, XtCreateApplicationContext and XtAppCreateShell).
See XtAppInitialize for a complete description of how the arguments are used.
Structures
typedef enum {
/∗ Value is ... ∗/
XrmoptionNoArg,/∗ specified in OptionDescRec.value ∗/
XrmoptionIsArg,/∗ the option string itself ∗/
XrmoptionStickyArg,/∗ characters immediately following option ∗/
XrmoptionSepArg,/∗ next argument in argv ∗/
XrmoptionResArg,/∗ next argument is input to XrmPutLineResource ∗/
/∗ Ignore this option and ... ∗/
XrmoptionSkipArg,/∗ the next argument in argv ∗/
XrmoptionSkipNArgs,/∗ Ignore this option and ... ∗/
/∗ the next value arguments in argv ∗/
XrmoptionSkipLine/∗ the rest of argv ∗/
} XrmOptionKind;
typedef struct {
char ∗option;/∗ Option name in argv ∗/
char ∗specifier;/∗ Resource name (without application name) ∗/
XrmOptionKind argKind;/∗ Which style of option it is ∗/
caddr_t value;/∗ Value to provide if XrmoptionNoArg ∗/
} XrmOptionDescRec, ∗XrmOptionDescList;
See Also
XtAppCreateShell(1), XtAppInitialize(1), XtCreateApplicationContext(1), XtDatabase(1), XtOpenDisplay(1).