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

# XtGetGC(3)

obtain and destroy a shareable GC

## NAME

XtGetGC, XtReleaseGC - obtain and destroy a shareable GC

## SYNTAX

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

GC XtGetGC(Widget *w*, XtGCMask *value\_mask*, XGCValues \**values*);

void XtReleaseGC(Widget *w*, GC *gc*);

## ARGUMENTS

- *gc*

  Specifies the GC to be deallocated.

- *values*

  Specifies the actual values for this GC.

- *value\_mask*

  Specifies which fields of the values are specified.

- *w*

  Specifies the widget.

## DESCRIPTION

The **XtGetGC** function returns a shareable, read-only GC. The parameters to this function are the same as those for **XCreateGC** except that a widget is passed instead of a display. **XtGetGC** shares only GCs in which all values in the GC returned by **XCreateGC** are the same. In particular, it does not use the value\_mask provided to determine which fields of the GC a widget considers relevant. The value\_mask is used only to tell the server which fields should be filled in with widget data and which it should fill in with default values. For further information about value\_mask and values, see **XCreateGC** in the *Xlib - C Language X Interface*.

The **XtReleaseGC** function deallocate the specified shared GC.

## SEE ALSO

*X Toolkit Intrinsics - C Language Interface*\
 *Xlib - C Language X Interface*
