1Tk_CreateClientMessageHandler(T3k)Library ProceduTrke_sCreateClientMessageHandler(3)
2
3
4
5______________________________________________________________________________
6
8 Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler - asso‐
9 ciate procedure callback with ClientMessage type X events
10
12 #include <tk.h>
13
14 Tk_CreateClientMessageHandler(proc)
15
16 Tk_DeleteClientMessageHandler(proc)
17
19 Tk_ClientMessageProc *proc (in) Procedure to invoke whenever
20 a ClientMessage X event oc‐
21 curs on any display.
22______________________________________________________________________________
23
25 Tk_CreateClientMessageHandler arranges for proc to be invoked in the
26 future whenever a ClientMessage X event occurs that is not handled by
27 WM_PROTOCOL. Tk_CreateClientMessageHandler is intended for use by ap‐
28 plications which need to watch X ClientMessage events, such as drag and
29 drop applications.
30
31 The callback to proc will be made by Tk_HandleEvent; this mechanism
32 only works in programs that dispatch events through Tk_HandleEvent (or
33 through other Tk procedures that call Tk_HandleEvent, such as
34 Tcl_DoOneEvent or Tk_MainLoop).
35
36 Proc should have arguments and result that match the type Tk_ClientMes‐
37 sageProc:
38 typedef int Tk_ClientMessageProc(
39 Tk_Window tkwin,
40 XEvent *eventPtr);
41 The tkwin parameter to proc is the Tk window which is associated with
42 this event. EventPtr is a pointer to the X event.
43
44 Whenever an X ClientMessage event is processed by Tk_HandleEvent, the
45 proc is called if it was not handled as a WM_PROTOCOL. The return
46 value from proc is normally 0. A non-zero return value indicates that
47 the event is not to be handled further; that is, proc has done all pro‐
48 cessing that is to be allowed for the event.
49
50 If there are multiple ClientMessage event handlers, each one is called
51 for each event, in the order in which they were established.
52
53 Tk_DeleteClientMessageHandler may be called to delete a previously-cre‐
54 ated ClientMessage event handler: it deletes each handler it finds that
55 matches the proc argument. If no such handler exists, then Tk_Delete‐
56 ClientMessageHandler returns without doing anything. Although Tk sup‐
57 ports it, it's probably a bad idea to have more than one callback with
58 the same proc argument.
59
61 bind, callback, event, handler
62
63
64
65Tk 8.4 Tk_CreateClientMessageHandler(3)