next up previous contents
Next: Rotating Components Up: Component Manipulation Previous: Component Manipulation

Moving and Deleting Components

Deleting and moving components is relatively simple using Tcl/Tk. The only difficult aspect is updating any wires which are connected to the component. When the user selects a component to move or delete, all the wire points which are attached to the ports of the components are determined using the component utility procedure cmp_get_point_ids. If the user is deleting the component, the internal netlist representation is updated using the netlist utility procedure net_list_remove_port which, in effect, disconnects the ports of the component from their respective netlists. The canvas delete command is then used to remove the component from the workarea. If the user is moving a component, then a binding is established which calls the canvas move command to adjust the location of the component as the user moves the mouse. The end points of any wires which are connected to the ports of the component are moved in harmony with the component itself using the netlist utility procedure net_do_move_point.



Donald Craig
Mon Jul 8 12:05:35 NDT 1996