Re: animation?

Dan Razzell (razzell@cs.ubc.ca)
Mon, 3 Mar 1997 14:54:21 +0100

I made a modification to the ined command to allow the form "ined eval"
which simply passes a command for evaluation in the context of Tkined.

For example, a Scotty interpreter can get the contents of a Tkined text
widget such as a clipboard, which gives an easy way to transmit
arbitrary commands and data from Tkined to an application:

ined -noupdate eval $text get $index1 $index2

Or the application can set the Tkined mouse cursor to show that processing
is underway in the application:

ined -noupdate eval $canvas configure -cursor $cursor

As it has to be implemented here, this capability is a bit of a hack.
First, it weakens the object formalism expressed in ined, though it
seems to be fairly weak to begin with. Second, it can be misused in
place of methods already supplied by ined. On the other hand, it or
something like it can be indispensable for giving access to Tkined
facilities that are not available through the other ined commands.

I suggested this to Juergen about a year ago, and he thought he would
add it to the next release. In fact it may be there now, though perhaps
not documented. I've been out of touch for awhile so I don't have the
latest release. When Juergen does the full Tkined rewrite, this sort of
capability will be more naturally integrated.

-----------------------------------------------------------------------------

Tkined 2.1.2: scotty/tkined/generic/tkiObjects.c:

629a630,651
> } else
> if ((argv[2][0] == 'e') && (strcmp(argv[2], "eval") == 0)) {
>
> /* Hand the rest of the command off for evaluation
> in the context of tkined.
> Meanwhile we have to reorder the argument list to
> suit the external syntax.
> It seems we also have to replace any newlines with
> semicolons to keep the Tcl parser happy later on.
> */
>
> tmp = argv[1]; argv[1] = argv[2]; argv[2] = tmp;
>
> cmd = Tcl_Merge (argc-2, argv+2);
> result = Tcl_Eval (interp, cmd);
> ckfree(cmd);
>
> for (p = interp->result; *p; p++)
> if (*p == '\n') *p = ';';
>
> tmp = argv[1]; argv[1] = argv[2]; argv[2] = tmp;
>

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.