---
name: "XtAppInitialize"
section: "3x"
platform: "linux"
package: "libxt-dev"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/XtAppInitialize/3x"
---

# XtAppInitialize(3x)

initialize, open, or close a display

## NAME

XtAppInitialize, XtVaAppInitialize - initialize, open, or close a display

## SYNTAX

Widget XtAppInitialize(XtAppContext\* *app\_context\_return*, String *application\_class*, XrmOptionDescRec\* *options*, Cardinal *num\_options*, int\* *argc\_in\_out*, String\* *argv\_in\_out*, String\* *fallback\_resources*, ArgList *args*, Cardinal *num\_args*);

Widget XtVaAppInitialize(XtAppContext\* *app\_context\_return*, String *application\_class*, XrmOptionDescRec\* *options*, Cardinal *num\_options*, int\* *argc\_in\_out*, String\* *argv\_in\_out*, String\* *fallback\_resources*, ...);

## ARGUMENTS

- *app\_context\_return*

  Specifies the application context.

- *application\_class*

  Specifies the class name of this application, which usually is the generic name for all instances of this application.

- *options*

  Specifies 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 *Xlib - C Language X Interface*.

- *num\_options*

  Specifies the number of entries in the options list.

- *argc\_in\_out*

  Specifies a pointer to the number of command line parameters.

- *argv\_in\_out*

  Specifies the command line parameters.

- *fallback\_resources*

  Specifies resource values to be used if the application class resource file cannot be opened or read, or NULL.

- *args*

  Specifies the argument list to override any other resource specification for the created shell widget.

- *num\_args*

  Specifies the number of entries in the argument list.

- *...*

  Specifies the variable argument list to override any other resource  specification for the created shell widget.

## DESCRIPTION

The *XtAppInitialize* function calls *XtToolkitInitialize* followed by *XtCreateApplicationContext*, then calls *XtOpenDisplay* with *display\_string* NULL and *application\_name* NULL, and finally calls *XtAppCreateShell* with *application\_name* NULL, *widget\_class* *applicationShellWidgetClass*, and the specified *args* and *num\_args* and returns the created shell. The modified *argc* and *argv* returned by *XtDisplayInitialize* are returned in *argc\_in\_out* and *argv\_in\_out*. If *app\_context\_return* is not NULL, the created application context is also returned. If the display specified by the command line cannot be opened, an error message is issued and *XtAppInitialize* terminates the application. If *fallback\_resources* is non-NULL, *XtAppSetFallbackResources* is called with the value prior to calling *XtOpenDisplay*.

XtAppInitialize and XtVaAppInitialize have been superceded by *XtOpenApplication* and *XtVaOpenApplication* respectively.

## SEE ALSO

XtOpenApplication(3Xt), XtVaOpenApplication(3Xt)\
 *X Toolkit Intrinsics - C Language Interface*\
 *Xlib - C Language X Interface*
