Tk_Main.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:2k
- '"
- '" Copyright (c) 1994 The Regents of the University of California.
- '" Copyright (c) 1994-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_Main.3,v 1.2 1998/09/14 18:22:54 stanton Exp $
- '"
- .so man.macros
- .TH Tk_Main 3 4.0 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_Main - main program for Tk-based applications
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- fBTk_MainfR(fIargc, argv, appInitProcfR)
- .SH ARGUMENTS
- .AS Tcl_AppInitProc *appInitProc
- .AP int argc in
- Number of elements in fIargvfR.
- .AP char *argv[] in
- Array of strings containing command-line arguments.
- .AP Tcl_AppInitProc *appInitProc in
- Address of an application-specific initialization procedure.
- The value for this argument is usually fBTcl_AppInitfR.
- .BE
- .SH DESCRIPTION
- .PP
- fBTk_MainfR acts as the main program for most Tk-based applications.
- Starting with Tk 4.0 it is not called fBmainfR anymore because it
- is part of the Tk library and having a function fBmainfR
- in a library (particularly a shared library) causes problems on many
- systems.
- Having fBmainfR in the Tk library would also make it hard to use
- Tk in C++ programs, since C++ programs must have special C++
- fBmainfR functions.
- .PP
- Normally each application contains a small fBmainfR function that does
- nothing but invoke fBTk_MainfR.
- fBTk_MainfR then does all the work of creating and running a
- fBwishfR-like application.
- .PP
- When it is has finished its own initialization, but before
- it processes commands, fBTk_MainfR calls the procedure given by
- the fIappInitProcfR argument. This procedure provides a ``hook''
- for the application to perform its own initialization, such as defining
- application-specific commands. The procedure must have an interface
- that matches the type fBTcl_AppInitProcfR:
- .CS
- typedef int Tcl_AppInitProc(Tcl_Interp *fIinterpfR);
- .CE
- fIAppInitProcfR is almost always a pointer to fBTcl_AppInitfR;
- for more details on this procedure, see the documentation
- for fBTcl_AppInitfR.
- .SH KEYWORDS
- application-specific initialization, command-line arguments, main program