1Tk_GetReliefFromObj(3) Tk Library Procedures Tk_GetReliefFromObj(3)
2
3
4
5______________________________________________________________________________
6
8 Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief - translate between
9 strings and relief values
10
12 #include <tk.h>
13
14 int │
15 Tk_GetReliefFromObj(interp, objPtr, reliefPtr) │
16
17 int
18 Tk_GetRelief(interp, name, reliefPtr)
19
20 CONST char *
21 Tk_NameOfRelief(relief)
22
24 Tcl_Interp *interp (in) Interpreter to use for error
25 reporting.
26
27 Tcl_Obj *objPtr (in/out) │
28 String value contains name of │
29 relief (one of flat, groove, │
30 raised, ridge, solid, or sunken); │
31 internal rep will be modified to │
32 cache corresponding relief value. │
33
34 char *string (in) │
35 Same as objPtr except description │
36 of relief is passed as a string.
37
38 int *reliefPtr (out) Pointer to location in which to
39 store relief value corresponding to
40 objPtr or name.
41
42 CONST char *name Name of the relief.
43
44 int relief (in) Relief value (one of
45 TK_RELIEF_FLAT, TK_RELIEF_RAISED,
46 TK_RELIEF_SUNKEN, TK_RELIEF_GROOVE,
47 TK_RELIEF_SOLID, or
48 TK_RELIEF_RIDGE).
49_________________________________________________________________
50
51
53 Tk_GetReliefFromObj places in *reliefPtr the relief value corresponding │
54 to the value of objPtr. This value will be one of TK_RELIEF_FLAT, │
55 TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, TK_RELIEF_GROOVE, TK_RELIEF_SOLID, │
56 or TK_RELIEF_RIDGE. Under normal circumstances the return value is │
57 TCL_OK and interp is unused. If objPtr doesn't contain one of the │
58 valid relief names or an abbreviation of one of them, then TCL_ERROR is │
59 returned, *reliefPtr is unmodified, and an error message is stored in │
60 interp's result if interp isn't NULL. Tk_GetReliefFromObj caches │
61 information about the return value in objPtr, which speeds up future │
62 calls to Tk_GetReliefFromObj with the same objPtr. │
63
64 Tk_GetRelief is identical to Tk_GetReliefFromObj except that the │
65 description of the relief is specified with a string instead of an │
66 object. This prevents Tk_GetRelief from caching the return value, so │
67 Tk_GetRelief is less efficient than Tk_GetReliefFromObj.
68
69 Tk_NameOfRelief is the logical inverse of Tk_GetRelief. Given a relief
70 value it returns the corresponding string (flat, raised, sunken,
71 groove, solid, or ridge). If relief isn't a legal relief value, then
72 ``unknown relief'' is returned.
73
74
76 name, relief, string
77
78
79
80Tk 8.1 Tk_GetReliefFromObj(3)