Re: animation?

Doug Hughes (Doug.Hughes@Eng.Auburn.EDU)
Wed, 26 Feb 1997 10:55:04 -0600

>>... lets assume it's link128 ...
>>set selected_item [tkined0 selection]
>># aside: if you do a [link128 editor] it will return tkined0
>>set canvas_oid [link128 items]
>>set canvas_id [link128 canvas]
>
>I'm feeling very dumb.
>
>I just get "invalid command" when I try to use tkined0 or such.
>
>I know that the job command creates a proc, but haven't seen anything
>else in the docs about ids being proc names, though I notice
>tkiObjects.c seems to do this.
>
>Can you give me a nudge in the right direction?
>Thanks,
>Brian Keck
>

My fault. I only tested these commands via a wish to tkined
using send. They work fine this way, but this is external
to tkined. I haven't (so far) been able to find a good way
inside an interpreter created by tkined (ip_monitor, snmp_monitor, etc)
to access back to the main tkined to get the coords of the
line. You can move the line inside any one of these interepreters.
And you can get tkined to send commands to these interpreters.
I haven't yet been able to find a good way to send a command
from the interpreter back up though, since they are created
using tcl and hence lack the 'send' command.

It is not hard to find the linkid, and then to move the link
if you want, but getting the coords has not worked so far.
You probably would be able to do it by adding an ined coords
command (which wouldn't be 'too' much work assuming you know
a little about programming C/Tcl - which may be a bad assumption)

Here's a sample little procedure I wrote in ip_monitor.tcl
called Test

proc Test { list } {
foreach litem $list {
case $litem in {
LINK* {set link [lindex $litem 1]}
NODE* {set link [lindex $litem 5]}
}

}
puts "litem $link"
puts [ined canvas $link]
}

(You could also add a case for NETWORK* which gets the
5th index item, but if you select a network, you should
expect to (normally) get back many links to many nodes,
so I omitted this case to reduce complexity since I would
assume that you would select the link directly anyway.)

Another possible option would be to write an external
Tcl/Tk program which would use send to do your animations
via the Tk communication mechanism. This would be similar
to my original posting. You could start up this external
program via a menu pull-down in one of the existing
interpreter/apps and use sockets to communicate between it
and the interpreter it is started from if necessary. (or
you could just use a file or pair of files, or named-pipe
or something)

--
____________________________________________________________________________
Doug Hughes					Engineering Network Services
System/Net Admin  				Auburn University
			doug@eng.auburn.edu

--
!! 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.