Tk_Init.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" 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: Tk_Init.3,v 1.4 2000/09/07 17:38:16 hobbs Exp $
- '"
- .so man.macros
- .TH Tk_Init 3 8.0 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_Init, Tk_SafeInit - add Tk to an interpreter and make a new Tk application.
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- int
- fBTk_InitfR(fIinterpfR)
- .sp
- int
- fBTk_SafeInitfR(fIinterpfR)
- .SH ARGUMENTS
- .AP Tcl_Interp *interp in
- Interpreter in which to load Tk. Tk should not already be loaded
- in this interpreter.
- .BE
- .SH DESCRIPTION
- .PP
- fBTk_InitfR is the package initialization procedure for Tk.
- It is normally invoked by the fBTcl_AppInitfR procedure
- for an application or by the fBloadfR command.
- fBTk_InitfR adds all of Tk's commands to fIinterpfR
- and creates a new Tk application, including its main window.
- If the initialization is successful fBTk_InitfR returns
- fBTCL_OKfR; if there is an error it returns fBTCL_ERRORfR.
- fBTk_InitfR also leaves a result or error message
- in fIinterp->resultfR.
- .PP
- If there is a variable fBargvfR in fIinterpfR, fBTk_InitfR
- treats the contents of this variable as a list of options for the
- new Tk application.
- The options may have any of the forms documented for the
- fBwishfR application (in fact, fBwishfR uses Tk_Init to process
- its command-line arguments).
- .PP
- fBTk_SafeInitfR is identical to fBTk_InitfR except that it removes
- all Tk commands that are considered unsafe. Those commands and the
- reasons for their exclusion are:
- .TP
- fBbellfR
- Continuous ringing of the bell is a nuisance.
- .TP
- fBclipboardfR
- A malicious script could replace the contents of the clipboard with
- the string fB"rm -r *"fR and lead to surprises when the contents of
- the clipboard are pasted.
- .TP
- fBgrabfR
- Grab can be used to block the user from using any other applications.
- .TP
- fBmenufR
- Menus can be used to cover the entire screen and to steal input from
- the user.
- .TP
- fBselectionfR
- See clipboard.
- .TP
- fBsendfR
- Send can be used to cause unsafe interpreters to execute commands.
- .TP
- fBtkfR
- The tk command recreates the send command, which is unsafe.
- .TP
- fBtkwaitfR
- Tkwait can block the containing process forever
- .TP
- fBtoplevelfR
- Toplevels can be used to cover the entire screen and to steal input
- from the user.
- .TP
- fBwmfR
- If toplevels are ever allowed, wm can be used to remove decorations,
- move windows around, etc.
- .SH KEYWORDS
- safe, application, initialization, load, main window