---
name: "GetRelief"
section: "3tk"
platform: "linux"
package: "tk8.3-doc"
version: "8.3.5-14"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/GetRelief/3tk"
---

# GetRelief(3tk)

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)

char *
Tk_NameOfRelief(relief)
```

## ARGUMENTS

- Tcl\_Interp *\*interp* (in)

  Interpreter to use for error reporting.\

- Tcl\_Obj *\*objPtr* (in/out)

  String value contains name of relief (one of **flat**, **groove**, **raised**, **ridge**, **solid**, or **sunken**); internal rep will be modified to cache corresponding relief value.

- char *\*string* (in)

  Same as *objPtr* except description of relief is passed as a string.

- int *\*reliefPtr* (out)

  Pointer to location in which to store relief value corresponding to *objPtr* or *name*.

- int *relief* (in)

  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* doesn't 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* isn't 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* isn't a legal relief value, then \`\`unknown relief'' is returned.

## KEYWORDS

name, relief, string
