---
name: "XtOpenApplication"
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/XtOpenApplication/3x"
---

# XtOpenApplication(3x)

initialize, open, or close a display

## NAME

XtOpenApplication, XtVaOpenApplication - initialize, open, or close a display

## SYNTAX

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

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

## 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.

- *widget\_class*

  Specifies the widget class of the shell to be created.

- *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 *XtOpenApplication* 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, the specified *widget\_class*, 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 *XtOpenApplication* 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

XtAppInitialize(3Xt), XtVaAppInitialize(3Xt)\
 *X Toolkit Intrinsics - C Language Interface*\
 *Xlib - C Language X Interface*
