[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tcl error in LinkItem creation
From: |
Marcus G. Daniels |
Subject: |
Re: Tcl error in LinkItem creation |
Date: |
19 Sep 1999 12:45:54 -0700 |
User-agent: |
Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4 |
>>>>> "DS" == Darren Schreiber <address@hidden> writes:
DS> I've added a linking method to my agents. It compiles, but it
DS> when I run it I get the following error:
DS> (Tcl -eval:) invalid command name "(null)" while executing
DS> "unknown_pre_tclObjc $name $args" (procedure "unknown" line 6)
DS> invoked from within "(null) create line 0 0 0 0 -arrow last"
Looks like the `graphCanvas' is null. Here's an example of using LinkItem.
#import <simtools.h>
#import <gui.h>
int
main (int argc, const char **argv)
{
id <Canvas> canvas;
id <NodeItem> node1, node2, node3;
id <LinkItem> link13, link23;
initSwarm (argc, argv);
canvas = [Canvas create: globalZone];
[canvas setWidth: 400 Height: 400];
[canvas setWindowTitle: "Canvas"];
[canvas pack];
node1 = [OvalNodeItem createBegin: globalZone];
[node1 setCanvas: canvas];
[node1 setX: 100 Y: 100];
[node1 setString: "N1"];
node1 = [node1 createEnd];
node2 = [OvalNodeItem createBegin: globalZone];
[node2 setCanvas: canvas];
[node2 setX: 300 Y: 100];
[node2 setString: "N2"];
node2 = [node2 createEnd];
node3 = [OvalNodeItem createBegin: globalZone];
[node3 setCanvas: canvas];
[node3 setX: 200 Y: 200];
[node3 setString: "N3"];
node3 = [node3 createEnd];
link13 = [LinkItem createBegin: globalZone];
[link13 setCanvas: canvas];
[link13 setFrom: node1];
[link13 setTo: node3];
link13 = [link13 createEnd];
link23 = [LinkItem createBegin: globalZone];
[link23 setCanvas: canvas];
[link23 setFrom: node2];
[link23 setTo: node3];
link23 = [link23 createEnd];
while (1) { while (GUI_EVENT_ASYNC ()) {} }
}
/*
Local Variables:
compile-command: "$SWARMHOME/bin/libtool-swarm --mode=link gcc -o canvas2 -g
-Wno-import -I$SWARMHOME/include -L$SWARMHOME/lib canvas2.m -lswarm -lobjc"
End:
*/
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.