1Tk_SetClassProcs(3) Tk Library Procedures Tk_SetClassProcs(3)
2
3
4
5______________________________________________________________________________
6
8 Tk_SetClassProcs - register widget specific procedures
9
11 #include <tk.h>
12
13 Tk_SetClassProcs(tkwin, procs, instanceData)
14
16 Tk_Window tkwin (in) Token for window to modify.
17
18 const Tk_ClassProcs *procs (in) Pointer to data structure con‐
19 taining widget specific proce‐
20 dures. The data structure
21 pointed to by procs must be
22 static: Tk keeps a reference to
23 it as long as the window ex‐
24 ists.
25
26 ClientData instanceData (in) Arbitrary one-word value to
27 pass to widget callbacks.
28______________________________________________________________________________
29
31 Tk_SetClassProcs is called to register a set of procedures that are
32 used as callbacks in different places.
33
34 The structure pointed to by procs contains the following:
35 typedef struct Tk_ClassProcs {
36 unsigned int size;
37 Tk_ClassWorldChangedProc *worldChangedProc;
38 Tk_ClassCreateProc *createProc;
39 Tk_ClassModalProc *modalProc;
40 } Tk_ClassProcs;
41 The size field is used to simplify future expansion of the structure.
42 It should always be set to (literally) sizeof(Tk_ClassProcs).
43
44 worldChangedProc is invoked when the system has altered in some way
45 that requires some reaction from the widget. For example, when a font
46 alias (see the font manual entry) is reconfigured, widgets configured
47 to use that font alias must update their display accordingly. world‐
48 ChangedProc should have arguments and results that match the type
49 Tk_ClassWorldChangedProc:
50 typedef void Tk_ClassWorldChangedProc(
51 ClientData instanceData);
52 The instanceData parameter passed to the worldChangedProc will be iden‐
53 tical to the instanceData parameter passed to Tk_SetClassProcs.
54
55 createProc is used to create platform-dependent windows. It is invoked
56 by Tk_MakeWindowExist. createProc should have arguments and results
57 that match the type Tk_ClassCreateProc:
58 typedef Window Tk_ClassCreateProc(
59 Tk_Window tkwin,
60 Window parent,
61 ClientData instanceData);
62 The tkwin and instanceData parameters will be identical to the tkwin
63 and instanceData parameters passed to Tk_SetClassProcs. The parent pa‐
64 rameter will be the parent of the window to be created. The createProc
65 should return the created window.
66
67 modalProc is invoked after all bindings on a widget have been triggered
68 in order to handle a modal loop. modalProc should have arguments and
69 results that match the type Tk_ClassModalProc:
70 typedef void Tk_ClassModalProc(
71 Tk_Window tkwin,
72 XEvent *eventPtr);
73 The tkwin parameter to modalProc will be identical to the tkwin parame‐
74 ter passed to Tk_SetClassProcs. The eventPtr parameter will be a
75 pointer to an XEvent structure describing the event being processed.
76
78 callback, class
79
80
81
82Tk 8.4 Tk_SetClassProcs(3)