Dear John,
> I am using Xcircuit 3.6.130.
>
> I execute the following on a selected label object.
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> (test) 57 % set position [label position]
> {300 0}
> (test) 58 % xcircuit::instance make in_pin $position
> list must contain x y positions
> (test) 59 %
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> It seems the list returned by [label position] command is malformed.
>
> I workaround this by extracting the x & y from $position and making a
> new list variable using "list" command it works.
Yes, there are several awkward workarounds. However, since you brought
it up, I took the time to see what the code was doing, and found that
the routine sees the variable itself as a list of one object (that
object being a list of two integers), rather than seeing it as the list
of two integers. It's easy enough to check to see if the position list
is nested.
I have committed the correction to the xcircuit-3.6 CVS database. You
can also just add the following lines above tclxcircuit.c line 573:
if (numobjs == 1) {
/* Try decomposing the object into a list */
result = Tcl_ListObjIndex(interp, list, 0, &tobj);
if (result == TCL_OK) {
result = Tcl_ListObjLength(interp, tobj, &numobjs);
if (numobjs == 2)
list = tobj;
}
if (result != TCL_OK) Tcl_ResetResult(interp);
}
and change line 563 to:
Tcl_Obj *lobj, *tobj;
This code should work both with your original test line 58, and with
your workaround.
Regards,
Tim
+--------------------------------+-------------------------------------+
| Dr. R. Timothy Edwards (Tim) | email: [email protected] |
| Open Circuit Design, Inc. | web: http://opencircuitdesign.com |
| 22815 Timber Creek Lane | phone: (301) 528-5030 |
| Clarksburg, MD 20871-4001 | cell: (240) 401-0616 |
+--------------------------------+-------------------------------------+
_______________________________________________
Xcircuit-dev mailing list
[email protected]
http://www.opencircuitdesign.com/mailman/listinfo/xcircuit-dev