wish buttons from c code works phine.
From
Conor Williams@21:1/5 to
All on Mon Oct 11 12:58:59 2021
when coding your Interp then
go:
"\n button .hij; " \
"\n .hij configure -text 'hij'; " \
"\n pack .hij; " \
to summarize...
all you have to do is:
put a \n at the start (which is a newline)
and and semicolon (;) within the quotes and then
a backslash (\) at the end of each line (as if
to join them)
/c:202111101954:22
ps: ---- Makefile ----
all:
gcc age4.c -I/usr/include/tcl8.6/ -I/usr/include/tk8.6 -ltk8.6 -ltcl8.6 -o age4
(make sure it's a tab before the word gcc in the Makefile and then type make where your c file is called age4.c)
pps: ---- age4.c ----
#include <tcl.h>
#include <tk.h>
#include <tclDecls.h>
#include <tclPlatDecls.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char **argv) {
Tcl_Interp *interp;
int code;
char *result;
printf("inside main function \n");
Tcl_FindExecutable(argv[0]);
interp = Tcl_CreateInterp();
//code = Tcl_Eval(interp, "source simple_addition.tcl; add_two_nos");
code = Tcl_Eval(interp, "#!/usr/bin/tclsh" \
"" \
"puts \"hello\"; " \
"button .but; .but configure -text \"asdf\"; pack .but"); result = Tcl_GetString(Tcl_GetObjResult(interp));
if (code == TCL_ERROR) {
fprintf(stderr, "ERROR in script: %s\n", result);
exit(1);
}
if (strlen(result)) {
printf("%s\n", result);
}
Tcl_DeleteInterp(interp);
exit(0);
}
/--snippett<<<---
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)