Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | <html> |
2 | <head> |
||
3 | <title>Mktclapp: Quick Reference</title> |
||
4 | </head> |
||
5 | <body bgcolor=white> |
||
6 | <h1 align=center>Quick Reference for Mktclapp</h1> |
||
7 | |||
8 | To create a new Tcl command named <b>abcdef</b> in C code, do this: |
||
9 | |||
10 | <blockquote><pre> |
||
11 | <b>int ET_COMMAND_abcdef(ET_TCLARGS){ |
||
12 | ... |
||
13 | } |
||
14 | </b></pre></blockquote> |
||
15 | |||
16 | The <b>ET_TCLARGS</b> macro declares four parameters:<p> |
||
17 | <ul> |
||
18 | <li> <b>clientData</b>. Always NULL for commands generated by mktclapp. |
||
19 | <li> <b>interp</b>. A pointer to the Tcl interpreter. |
||
20 | <li> <b>argc</b>. Number of arguments to the Tcl command. |
||
21 | <li> <b>argv</b>. Value of each argument. |
||
22 | </ul> |
||
23 | |||
24 | <p> |
||
25 | The C implementation of Tcl commands must return one |
||
26 | of the following integer values: |
||
27 | <b>TCL_OK</b>, |
||
28 | <b>TCL_ERROR</b>, |
||
29 | <b>TCL_CONTINUE</b>, |
||
30 | <b>TCL_BREAK</b>, or |
||
31 | <b>TCL_RETURN</b>. |
||
32 | |||
33 | <p> |
||
34 | To create a new Obj_Tcl command named <b>ghijkl</b> in C code, do this: |
||
35 | |||
36 | <blockquote><pre> |
||
37 | <b>int ET_OBJCOMMAND_ghijkl(ET_OBJARGS){ |
||
38 | ... |
||
39 | } |
||
40 | </b></pre></blockquote> |
||
41 | |||
42 | <p> |
||
43 | The following extra C functions are available: |
||
44 | <p> |
||
45 | <ul> |
||
46 | <li> int <b>Et_EvalF</b>(Tcl_Interp *interp, const char *zFormat, ...); |
||
47 | <li> int <b>Et_GlobalEvalF</b>(Tcl_Interp *interp, const char *zFormat, ...); |
||
48 | <li> int <b>Et_ResultF</b>(Tcl_Interp *interp, const char *zFormat, ...); |
||
49 | <li> int <b>Et_DStringAppendF</b>(Tcl_DString *, const char *zFormat, ...); |
||
50 | <li> char *<b>mprintf</b>(const char *zFormat, ...); |
||
51 | <li> char *<b>vmprintf</b>(const char *zFormat, va_list); |
||
52 | </ul> |
||
53 | |||
54 | <p> |
||
55 | Global C variables:<p> |
||
56 | <ul> |
||
57 | <li> Tcl_Interp *<b>Et_Interp</b>;<p> |
||
58 | </ul> |
||
59 | |||
60 | <p> |
||
61 | Global Tcl variables:<p> |
||
62 | <ul> |
||
63 | <li> <b>Et_EvalTrace</b>;<p> |
||
64 | </ul> |
||
65 | |||
66 | <p> |
||
67 | Mktclapp will create suitable implementations of the following functions |
||
68 | if you fail to do so yourself:<p> |
||
69 | <ul> |
||
70 | <li> int <b>main</b>(int argc, char **argv); |
||
71 | |||
72 | <li> int <b>Et_PreInit</b>(Tcl_Interp *interp); |
||
73 | <li> int <b>Et_AppInit</b>(Tcl_Interp *interp); |
||
74 | </ul> |
||
75 | <p> |
||
76 | If you make your own <b>main</b>, but sure it calls the routine |
||
77 | <b>Et_Init</b>(argc,argv) at some point in order to create and |
||
78 | initialize the Tcl interpreter.<p> |
||
79 | |||
80 | To run the graphical application builder, type |
||
81 | |||
82 | <blockquote> |
||
83 | <b>wish xmktclapp.tcl</b> |
||
84 | </blockquote> |
||
85 | |||
86 | To run from the command line (or from within a Makefile) enter |
||
87 | "<b>mktclapp</b> <i>options...</i>" For information on |
||
88 | available options, type "<b>mktclapp -help</b>". |
||
89 | |||
90 | <p> |
||
91 | See complete documentation on mktclapp at |
||
92 | <a href="http://www.hwaci.com/sw/mktclapp/mktclapp.html"> |
||
93 | http://www.hwaci.com/sw/mktclapp/mktclapp.html</a>. |
||
94 | </body> |
||
95 | </html> |