1Tk_SetClassProcs(3)          Tk Library Procedures         Tk_SetClassProcs(3)
2
3
4
5______________________________________________________________________________
6

NAME

8       Tk_SetClassProcs - register widget specific procedures
9

SYNOPSIS

11       #include <tk.h>
12
13       Tk_SetClassProcs(tkwin, procs, instanceData)
14

ARGUMENTS

16       Tk_Window tkwin (in)                    Token for window to modify.
17
18       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
24                                               exists.
25
26       ClientData instanceData (in)            Arbitrary   one-word  value  to
27                                               pass to widget callbacks.
28_________________________________________________________________
29
30

DESCRIPTION

32       Tk_SetClassProcs is called to register a set  of  procedures  that  are
33       used as callbacks in different places.
34
35       The structure pointed to by procs contains the following:
36              typedef struct Tk_ClassProcs {
37                  unsigned int size;
38                  Tk_ClassWorldChangedProc *worldChangedProc;
39                  Tk_ClassCreateProc *createProc;
40                  Tk_ClassModalProc *modalProc;
41              } Tk_ClassProcs;
42       The  size  field is used to simplify future expansion of the structure.
43       It should always be set to (literally) sizeof(Tk_ClassProcs).
44
45       worldChangedProc is invoked when the system has  altered  in  some  way
46       that  requires some reaction from the widget.  For example, when a font
47       alias (see the font manual entry) is reconfigured,  widgets  configured
48       to  use  that font alias must update their display accordingly.  world‐
49       ChangedProc should have arguments  and  results  that  match  the  type
50       Tk_ClassWorldChangedProc:
51              typedef void Tk_ClassWorldChangedProc(
52                  ClientData instanceData);
53       The instanceData parameter passed to the worldChangedProc will be iden‐
54       tical to the instanceData parameter passed to Tk_SetClassProcs.
55
56       createProc is used to create platform-dependant windows.  It is invoked
57       by  Tk_MakeWindowExist.   createProc  should have arguments and results
58       that match the type Tk_ClassCreateProc:
59              typedef Window Tk_ClassCreateProc(
60                  Tk_Window tkwin,
61                  Window parent,
62                  ClientData instanceData);
63       The tkwin and instanceData parameters will be identical  to  the  tkwin
64       and  instanceData  parameters  passed  to Tk_SetClassProcs.  The parent
65       parameter will be the parent of the window to  be  created.   The  cre‐
66       ateProc should return the created window.
67
68       modalProc is invoked after all bindings on a widget have been triggered
69       in order to handle a modal loop.  modalProc should have  arguments  and
70       results that match the type Tk_ClassModalProc:
71              typedef void Tk_ClassModalProc(
72                  Tk_Window tkwin,
73                  XEvent *eventPtr);
74       The tkwin parameter to modalProc will be identical to the tkwin parame‐
75       ter passed to Tk_SetClassProcs.   The  eventPtr  parameter  will  be  a
76       pointer to an XEvent structure describing the event being processed.
77
78

KEYWORDS

80       callback, class
81
82
83
84Tk                                    8.4                  Tk_SetClassProcs(3)
Impressum