1TclXInit(TCL)                                                    TclXInit(TCL)
2
3
4

NAME

6       Tclx_Init,  Tclxcmd_Init,  TclX_Main, Tkx_Init, TkX_Main - Extended Tcl
7       initialization.
8

SYNOPSIS

10       -ltclx -ltcl
11
12       #include "tclExtend.h"
13
14       int
15       Tclx_Init (Tcl_Interp *interp);
16
17       int
18       Tclxcmd_Init (Tcl_Interp *interp);
19
20       int
21       void
22       TclX_Main (int               argc,
23                  char            **argv,
24                  Tcl_AppInitProc  *appInitProc);
25
26       int
27       Tkx_Init (Tcl_Interp *interp);
28
29       void
30       TkX_Main (int               argc,
31                 char            **argv,
32                 Tcl_AppInitProc  *appInitProc);
33
34       void
35       TclX_SetAppInfo (int   defaultValues,
36                        char *appName,
37                        char *appLongName,
38                        char *appVersion,
39                        int   appPatchlevel);
40
41

DESCRIPTION

43       These functions are used to initialize Extended  Tcl  and  applications
44       based  on Extended Tcl.  This manual page also discusses various issues
45       and approaches of integrating TclX into other applications.
46
47   Tclx_Init
48       Initializes Extended Tcl, adding the extended command set to the inter‐
49       preter.  This is called from Tcl_AppInit.  This function must be called
50       after the Tcl_Init function.  In addition to the standard command  set,
51       it  enables  use of tlib packages libraries and makes the standard TclX
52       library available.
53
54
55       Parameters
56         o interp - A pointer to the interpreter to add the commands to.
57
58       Returns:
59         TCL_OK if all is ok, TCL_ERROR if an error occurred.
60
61   Tclxcmd_Init
62       Add the TclX command set to the interpreter, with the exception of  the
63       TclX library management commands.  This is normally called by Tclx_Init
64       and should only be used if you don't want the TclX library handling.
65
66       Parameters
67         o interp - A pointer to the interpreter to add the commands to.
68
69       Returns:
70         TCL_OK if all is ok, TCL_ERROR if an error occurred.
71
72   TclX_Main
73       This function parses the command line according to the TclX shell spec‐
74       ification (Unix shell compatible).  It creates an interpreter and calls
75       the specified function appInitProc to initialize any  application  spe‐
76       cific  commands.  It then either evaluates the command of script speci‐
77       fied on the command line or enters an interactive command  loop.   This
78       procedure  never  returns,  it exits the process when it's done.  Using
79       the TclX shell also gives you SIGINT handling in interactive shells.
80
81   Tkx_Init
82       Initializes  Extended  Tcl  Tk  environment.   This  is   called   from
83       Tcl_AppInit after the Tk_Init function.
84
85       Parameters
86         o interp - A pointer to the interpreter to add the commands to.
87
88       Returns:
89         TCL_OK if all is ok, TCL_ERROR if an error occurred.
90
91   TkX_Main
92       This function parses the command line according to the wish shell spec‐
93       ification.  It creates an interpreter and calls the specified  function
94       appInitProc  to  initialize any application specific commands.  It then
95       either evaluates the command of script specified on the command line or
96       enters  an  interactive command loop.  This procedure never returns, it
97       exits the process when it's done.  Using the TclX wish shell gives  you
98       SIGINT  handling  in  interactive  shells, otherwise it is identical to
99       standard wish.
100
101   TclX_SetAppInfo
102       Store the application information returned by infox.
103
104       Parameters
105         o defaultValues - If true, then the values are assigned only if  they
106         are not already defined (defaulted).  If false, the values are always
107         set.
108         o appName - Application symbolic name.
109         o appLongName - Long, natural language application name.
110         o appVersion - Version number of the application.
111         o appPatchlevel - Patch level of the application.  If less than zero,
112         don't change.
113
114       String  pointers  are  saved without copying, don't release the memory.
115       If the arguments are NULL, don't change the values.
116

DYNAMIC LOADING OF TCLX

118       TclX can be dynamically loaded on systems that support shared libraries
119       and  the  load  command.  This can be done using either the load or the
120       package require commands.  If package require is to be used,  a  pkgIn‐
121       dex,tcl  must  be  constructed.   The  pkg_mkIndex  does not generate a
122       pkgIndex.tcl file that works with TclX.  Instead a command similar to
123
124         package ifneeded Tclx 7.5.0 "load $dir/libtclx.so"
125
126       should be placed in the directory containing the TclX  shared  library.
127       A  prototype pkgIndex,tcl file is build by TclX and is installed in the
128       run time directory under the name  pkgIndex,proto.  This file can't  be
129       used as-is, but should be renamed and copied or combined with an exist‐
130       ing pkgIndex,tcl in the directory containing the shared library.
131
132       There is no need to dynamically load libtkx.so, since it only  contains
133       support for wishx.
134
135
136

INTEGRATING TCLX WITH OTHER EXTENSIONS AND APPLICATIONS

138       The  main  aspects  to  integrating TclX with into an application is to
139       decide if the application is based on the standard Tcl/Tk shells or the
140       TclX shells.  If the standard shells are desired, then all that is nec‐
141       essary is to call Tclx_Init after Tcl_Init and
142        Tkx_Init after Tk_Init.  This functionality may  also  be  dynamically
143       loaded.
144
145       To  get  the TclX shell in a Tcl only application, with the tcl command
146       functionality,  call  TclX_Main  from  the  main  function  instead  of
147       Tcl_Main.  This shell has arguments conforming to other Unix shells and
148       SIGINT signal handling when interactive,.
149
150       To get the Tclx shell in a Tk application, with the wishx command func‐
151       tionality,  call  TkX_Main  from  the main function instead of Tk_Main.
152       This shell has SIGINT signal handling when interactive,
153
154
155
156
157
158Tcl                                                              TclXInit(TCL)
Impressum