---
name: "GetRelief"
section: "3"
platform: "macos"
package: "tcl"
version: "152"
release: "macOS 26.5"
platforms: ["macos"]
url: "https://new.carta.tech/GetRelief/3"
---

# GetRelief(3)

translate between strings and relief values

## NAME

Tk\_GetReliefFromObj, Tk\_GetRelief, Tk\_NameOfRelief - translate between strings and relief values

## SYNOPSIS

```
#include <tk.h>

int
Tk_GetReliefFromObj(interp, objPtr, reliefPtr)

int
Tk_GetRelief(interp, name, reliefPtr)

const char *
Tk_NameOfRelief(relief)
```

## ARGUMENTS

Interpreter to use for error reporting. String value contains name of relief, one of or the internal rep will be modified to cache corresponding relief value. Same as *objPtr* except description of relief is passed as a string. Pointer to location in which to store relief value corresponding to *objPtr* or *name*. Name of the relief. Relief value (one of **TK\_RELIEF\_FLAT**, **TK\_RELIEF\_RAISED**, **TK\_RELIEF\_SUNKEN**, **TK\_RELIEF\_GROOVE**, **TK\_RELIEF\_SOLID**, or **TK\_RELIEF\_RIDGE**).

## DESCRIPTION

**Tk\_GetReliefFromObj** places in *\*reliefPtr* the relief value corresponding to the value of *objPtr*.  This value will be one of **TK\_RELIEF\_FLAT**, **TK\_RELIEF\_RAISED**, **TK\_RELIEF\_SUNKEN**, **TK\_RELIEF\_GROOVE**, **TK\_RELIEF\_SOLID**, or **TK\_RELIEF\_RIDGE**. Under normal circumstances the return value is **TCL\_OK** and *interp* is unused. If *objPtr* does not contain one of the valid relief names or an abbreviation of one of them, then **TCL\_ERROR** is returned, *\*reliefPtr* is unmodified, and an error message is stored in *interp*'s result if *interp* is not NULL. **Tk\_GetReliefFromObj** caches information about the return value in *objPtr*, which speeds up future calls to **Tk\_GetReliefFromObj** with the same *objPtr*.

**Tk\_GetRelief** is identical to **Tk\_GetReliefFromObj** except that the description of the relief is specified with a string instead of an object.  This prevents **Tk\_GetRelief** from caching the return value, so **Tk\_GetRelief** is less efficient than **Tk\_GetReliefFromObj**.

**Tk\_NameOfRelief** is the logical inverse of **Tk\_GetRelief**. Given a relief value it returns the corresponding string (**flat**, **raised**, **sunken**, **groove**, **solid**, or **ridge**). If *relief* is not a legal relief value, then is returned.

## KEYWORDS

name, relief, string
