Re: animation?

Doug Hughes (Doug.Hughes@Eng.Auburn.EDU)
Tue, 25 Feb 1997 08:27:22 -0600

>This is a resend - sorry if you've seen it. It never came back to me,
>except in a bounce from somewhere I've never heard of, though it made
>it into the htmlized archive.
>
>I've been trying to do some animation, & have a few questions.
>The idea is to show packets moving around a network.
>
>The obvious question is whether anyone else has done it. I fetched the
>1966 mail archive & couldn't see anything.
>
>My attempts are a bit clumsy, but attached since it might make my
>meaning clearer.
>
>Is there a way of getting the coordinates of the endpoints of a link?
>The method below uses the bounding box (ined size ...), but has to
>mess around to figure out which 2 of the 4 corners are the endpoints.
>
>Is it possible to draw more than bitmaps (and graphs etc)?
>(Here as elsewhere I'm hoping not to have to change tkined itself.)
>
>Is it possible to make keyboard or mouse events on the main canvas (if
>that's the right expression) notify my application? I know my
>application can add a menu but I'd like more flexibility.
>
>Can I add entries to the button-3 per-object menus that send to my
>application?
>
>Sorry to sound ungrateful - I really like tkined.
>
>Thanks for any help,
>Brian Keck
>

Here's one way to do it. Find the link or network item that
you want to get the end points of. You can do this by
selecting it and then finding which item is selected.

Once you have that, lets assume it's link128 and go from
there.

Let's assume for now that you only have one instance of tkined
running with one canvas/map inside it. You can get the name
of the link that is selected like this:

set selected_item [tkined0 selection]
(which for this example returns link128)
# aside: if you do a [link128 editor] it will return tkined0

set canvas_oid [link128 items]
set canvas_id [link128 canvas]
$canvas_id bbox $canvas_oid

This gives you 4 coordinates that equal the two end points
of the line.

You could draw more than bitmaps/graphs perhaps by integrating
the 'plus' patches. It adds better support for images in the
canvas widget. You would probably have to change tkined to
get it to do what you want though.

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