TCL TK Introduction to first Use case
Use Case - 1 : Opening a File
What was done:
Because we didn't want to sit around waiting for the PP Group we
designed the Tcl/Tk to keep track of objects so that we could
design and test our code as soon as possible. This saved us a lot
of debugging time and we had better code ready by the time the PP
Group was ready.
We did a lot of work getting the Toolbar and Main Window working.
Inorder to have ability to draw objects that the PP Group
would hand us, we needed to work on getting the user interaction working.
The exact same code gets called for either user interaction
or opening a file. And since we didn't have the PP Groups stuff to
test, we tested our code through the user interaction.
Along with the non-functioning menus item and and mostly working tools, an
open dialog box was created.
Bugs:
1. The C++ calls were written incorrectly.
2. Once the C++ calls were correct, the open feature started an endless loop.
Fixes:
1. The C++ calls needed to be called through the Graph object example;
set iGraph [Graph new:] - Creates Graph object (need it only once)
$iGraph cppCreAVertex: $lbl $formatted $formatted2
2. We were appending the newly created objects from the open function back
to the C++ side of things. When C++ finish, there was then a whole
new (dupicate) set of objects that it would again send back to
Tcl/Tk....only to get dupicated again....again...again...
It was fixed by only sending user created objects to C++ and to
not to send the data if C++ makes the object.
-----------------------------------------
Use Case 1 -
Most of the work done was with the toolbar.tcl and
getting the drawing stuff to work in edge.tcl, vertex.tcl, and
bindings.tcl. The edge.tcl and vertex.tcl allowed the objects
to be created. The user interaction was started in toolbar.tcl
and bindings.tcl. We also spent a lot time discussing and
developing how we were going to interact with the PP Group's
code.