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

# XtCreateApplicationContext(3)

create, destroy, and obtain an application context

## NAME

XtCreateApplicationContext, XtDestroyApplicationContext, XtWidgetToApplicationContext, XtToolkitInitialize - create, destroy, and obtain an application context

## SYNTAX

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

XtAppContext XtCreateApplicationContext(void);

void XtDestroyApplicationContext(XtAppContext *app\_context*);

XtAppContext XtWidgetToApplicationContext(Widget *w*);

void XtToolkitInitialize(void);

## ARGUMENTS

- *app\_context*

  Specifies the application context.

- *w*

  Specifies the widget that you want the application context for.

## DESCRIPTION

The **XtCreateApplicationContext** function returns an application context, which is an opaque type. Every application must have at least one application context.

The **XtDestroyApplicationContext** function destroys the specified application context as soon as it is safe to do so. If called from with an event dispatch (for example, a callback procedure), **XtDestroyApplicationContext** does not destroy the application context until the dispatch is complete.

The **XtWidgetToApplicationContext** function returns the application context for the specified widget.

The **XtToolkitInitialize** function initializes the Intrinsics internals. If **XtToolkitInitialize** was previously called it returns immediately.

## SEE ALSO

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