---
name: "XtOpenApplication"
section: "3"
platform: "linux"
package: "libxt"
version: "1.3.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XtOpenApplication"
---

# XtOpenApplication(3)

initialize, open, or close a display

## NAME

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

## SYNTAX

\#include \<X11/Intrinsic.h\>

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

Widget XtVaOpenApplication(XtAppContext \**app\_context\_return*, const char \**application\_class*, XrmOptionDescRec \**options*, Cardinal *num\_options*, int \**argc\_in\_out*, char \*\**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 superseded by **XtOpenApplication** and **XtVaOpenApplication** respectively.

## SEE ALSO

[XtAppInitialize(3)](/XtAppInitialize/3.md), [XtVaAppInitialize(3)](/XtVaAppInitialize/3.md)\
 *X Toolkit Intrinsics - C Language Interface*\
 *Xlib - C Language X Interface*
