'\" '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" RCS: @(#) $Id: loadTk.n,v 1.2 2003/11/24 05:09:59 bbbush Exp $ '\" '\" The definitions below are for supplemental macros used in Tcl/Tk '\" manual entries. '\" '\" .AP type name in/out ?indent? '\" Start paragraph describing an argument to a library procedure. '\" type is type of argument (int, etc.), in/out is either "in", "out", '\" or "in/out" to describe whether procedure reads or modifies arg, '\" and indent is equivalent to second arg of .IP (shouldn't ever be '\" needed; use .AS below instead) '\" '\" .AS ?type? ?name? '\" Give maximum sizes of arguments for setting tab stops. Type and '\" name are examples of largest possible arguments that will be passed '\" to .AP later. If args are omitted, default tab stops are used. '\" '\" .BS '\" Start box enclosure. From here until next .BE, everything will be '\" enclosed in one large box. '\" '\" .BE '\" End of box enclosure. '\" '\" .CS '\" Begin code excerpt. '\" '\" .CE '\" End code excerpt. '\" '\" .VS ?version? ?br? '\" Begin vertical sidebar, for use in marking newly-changed parts '\" of man pages. The first argument is ignored and used for recording '\" the version when the .VS was added, so that the sidebars can be '\" found and removed when they reach a certain age. If another argument '\" is present, then a line break is forced before starting the sidebar. '\" '\" .VE '\" End of vertical sidebar. '\" '\" .DS '\" Begin an indented unfilled display. '\" '\" .DE '\" End of indented unfilled display. '\" '\" .SO '\" Start of list of standard options for a Tk widget. The '\" options follow on successive lines, in four columns separated '\" by tabs. '\" '\" .SE '\" End of list of standard options for a Tk widget. '\" '\" .OP cmdName dbName dbClass '\" Start of description of a specific option. cmdName gives the '\" option's name as specified in the class command, dbName gives '\" the option's name in the option database, and dbClass gives '\" the option's class in the option database. '\" '\" .UL arg1 arg2 '\" Print arg1 underlined, then print arg2 normally. '\" '\" RCS: @(#) $Id: loadTk.n,v 1.2 2003/11/24 05:09:59 bbbush Exp $ '\" '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. .TH "loadTk" 3tk 8.0 Tk "Tk Built-In Commands" .SH NAME loadTk \- 把 Tk 裝載到一個安全解釋器中。 .SH "總覽 SYNOPSIS" \fB::safe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? Safe Tk 基於 Safe Tcl 之上,它提供一種機制,允許對自動裝載和安全解釋器的包的受限制和有中介的訪問。Safe Tk 增加爲安全 Tk 操作配置解釋器和把 Tk 裝載到安全解釋器的功能。 .SH "描述 DESCRIPTION" .PP \fB::safe::loadTk\fR 命令在指明的解釋器中初始化需要的數據結構並把 Tk 裝載到其中。這個命令返回這個安全解釋器的名字。如果指定了 \fB\-use\fR,使用由指定的系統決定的標識符 \fIwindowId\fR 所標識的窗口來包含這個解釋器的 ``.'' 窗口;它可以是任何有效的 id,最終引用屬於另一個應用的一個窗口。出於方便,如果你想要使用的窗口是應用的一個 Tk 窗口,則你可以使用這個窗口的名字(比如: \fB.x.y\fR)來替代它的窗口 Id (\fB[winfo id .x.y]\fR)。在未指定 \fB-use\fR 的時候,爲這個安全解釋器的 ``.'' 窗口建立一個新的頂層窗口。在 X11 上如果你想讓嵌入的窗口使用其他的顯示器而不是缺省的那個,可以用 \fB\-display\fR 指定它。實現的細節請參見下面的安全要點 (\fBSECURITY ISSUES\fR) 章節。 .SH "安全要點 SECURITY ISSUES" .PP 請閱讀 Tcl 的 \fBsafe\fR 手冊頁來獲悉對 Safe Tcl 做的基本安全考慮。 .PP \fB::safe::loadTk\fR 把從解釋器接受的 \fBtk_library\fR 的值增加到安全解釋器的虛擬路徑上,這樣自動裝載就能在安全解釋器中工作了。 .PP .PP 就不信任從解釋器對啓動的陳述而論,Tk 初始化現在是安全的。\fB::safe::loadTk\fR 註冊從解釋器的名字,這樣在調用 Tk 初始化(\fBTk_SafeInit\fR)和依次調用主解釋器的 \fB::safe::InitTk\fR 的時候,它將返回想要的 \fBargv\fR 等價物(\fB\-use\fR \fIwindowId\fR,正確的 \fB\-display \fR等等...)。 .PP 在未使用 \fB\-use\fR 的時候,對新建立的頂層窗口進行特殊裝飾,這樣用戶總能意識到呈現的用戶界面來自潛在不安全的代碼並可以輕易的刪除相應的解釋器。 .PP 在 X11 上,有衝突的 \fB\-use\fR 和 \fB\-display\fR 將生成一個致命的 X 錯誤。 .SH "參見 SEE ALSO" safe(n), interp(n), library(n), load(n), package(n), source(n), unknown(n) .SH "關鍵字 KEYWORDS" alias, auto\-loading, auto_mkindex, load, master interpreter, safe interpreter, slave interpreter, source .SH "[中文版維護人]" .B 寒蟬退士 .SH "[中文版最新更新]" .B 2002/05/15 .SH "《中國 Linux 論壇 man 手冊頁翻譯計劃》:" .BI http://cmpp.linuxforum.net .SH "跋" .br 本頁面中文版由中文 man 手冊頁計劃提供。 .br 中文 man 手冊頁計劃:\fBhttps://github.com/man-pages-zh/manpages-zh\fR