1Safe Tk(n) Tk Built-In Commands Safe Tk(n)
2
3
4
5______________________________________________________________________________
6
8 safe::loadTk - Load Tk into a safe interpreter.
9
11 safe::loadTk child ?-use windowId? ?-display displayName?
12______________________________________________________________________________
13
15 Safe Tk is based on Safe Tcl, which provides a mechanism that allows
16 restricted and mediated access to auto-loading and packages for safe
17 interpreters. Safe Tk adds the ability to configure the interpreter
18 for safe Tk operations and load Tk into safe interpreters.
19
20 The safe::loadTk command initializes the required data structures in
21 the named safe interpreter and then loads Tk into it. The interpreter
22 must have been created with safe::interpCreate or have been initialized
23 with safe::interpInit. The command returns the name of the safe inter‐
24 preter. If -use is specified, the window identified by the specified
25 system dependent identifier windowId is used to contain the “.” window
26 of the safe interpreter; it can be any valid id, eventually referencing
27 a window belonging to another application. As a convenience, if the
28 window you plan to use is a Tk Window of the application you can use
29 the window name (e.g., “.x.y”) instead of its window Id (e.g., from
30 winfo id .x.y). When -use is not specified, a new toplevel window is
31 created for the “.” window of the safe interpreter. On X11 if you want
32 the embedded window to use another display than the default one, spec‐
33 ify it with -display. See the SECURITY ISSUES section below for imple‐
34 mentation details.
35
37 Please read the safe manual page for Tcl to learn about the basic secu‐
38 rity considerations for Safe Tcl.
39
40 safe::loadTk adds the value of tk_library taken from the parent inter‐
41 preter to the virtual access path of the safe interpreter so that auto-
42 loading will work in the safe interpreter.
43
44 Tk initialization is now safe with respect to not trusting the child's
45 state for startup. safe::loadTk registers the child's name so when the
46 Tk initialization (Tk_SafeInit) is called and in turn calls the par‐
47 ent's safe::InitTk it will return the desired argv equivalent (-use
48 windowId, correct -display, etc.)
49
50 When -use is not used, the new toplevel created is specially decorated
51 so the user is always aware that the user interface presented comes
52 from a potentially unsafe code and can easily delete the corresponding
53 interpreter.
54
55 On X11, conflicting -use and -display are likely to generate a fatal X
56 error.
57
59 safe(n), interp(n), library(n), load(n), package(n), source(n), un‐
60 known(n)
61
63 alias, auto-loading, auto_mkindex, load, parent interpreter, safe in‐
64 terpreter, child interpreter, source
65
66
67
68Tk 8.0 Safe Tk(n)