1Tk_SetAppName(3) Tk Library Procedures Tk_SetAppName(3)
2
3
4
5______________________________________________________________________________
6
8 Tk_SetAppName - Set the name of an application for 'send' commands
9
11 #include <tk.h>
12
13 const char *
14 Tk_SetAppName(tkwin, name)
15
17 Tk_Window tkwin (in) Token for window in application. Used
18 only to select a particular application.
19
20 const char *name (in) Name under which to register the appli‐
21 cation.
22______________________________________________________________________________
23
25 Tk_SetAppName associates a name with a given application and records
26 that association on the display containing with the application's main
27 window. After this procedure has been invoked, other applications on
28 the display will be able to use the send command to invoke operations
29 in the application. If name is already in use by some other applica‐
30 tion on the display, then a new name will be generated by appending “
31 #2” to name; if this name is also in use, the number will be incre‐
32 mented until an unused name is found. The return value from the proce‐
33 dure is a pointer to the name actually used.
34
35 If the application already has a name when Tk_SetAppName is called,
36 then the new name replaces the old name.
37
38 Tk_SetAppName also adds a send command to the application's inter‐
39 preter, which can be used to send commands from this application to
40 others on any of the displays where the application has windows.
41
42 The application's name registration persists until the interpreter is
43 deleted or the send command is deleted from interp, at which point the
44 name is automatically unregistered and the application becomes inacces‐
45 sible via send. The application can be made accessible again by call‐
46 ing Tk_SetAppName.
47
48 Tk_SetAppName is called automatically by Tk_Init, so applications do
49 not normally need to call it explicitly.
50
51 The command tk appname provides Tcl-level access to the functionality
52 of Tk_SetAppName.
53
55 application, name, register, send command
56
57
58
59Tk 4.0 Tk_SetAppName(3)