微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微电子和IC设计 > IC后端设计交流 > 求教一个laker下的tcl程序问题

求教一个laker下的tcl程序问题

时间:10-02 整理:3721RD 点击:
小弟初来乍到,有个tcl的问题,求教高手帮忙解答。我在laker下的程序是这么写的:
Set addLoc [gtCreateButton -name addSymbol -buttonText “Add Location”\
-callback {for {set a 1} {$a <= 7} {incr a 1} {
Set location($a) [gtCreatePointField -name Location($a)\
-editable t\
-prompt “Location”\
-value (0,0)\
-defValue (0,0) ]
gtAddFields –handle $form –fields [ list $location($a)]}}]
set form [gtCreateAppForm -name Form\
-title "Form:"
-buttonLayout OKCancelDefApply
-fields [list $addLoc]
-callback {for {set a 1} {$a <= 7} {incr a 1} {
set data $Form(Location($a):value)
puts "$data"}}]
getDisplay -handle $form
结果报错,*GuiTcl* Error: can't read "Form(Location(1)": no such element in array.
请问这个问题应该如何解决呢?

好久没用laker了,看了一下,觉得这一句:
gtAddFields –handle $form –fields [ list $location($a)]}}]
应该放在这一句:
getDisplay -handle $form
的前面。即最后几行应该这样:
set form [gtCreateAppForm -name Form\
-title "Form:"
-buttonLayout OKCancelDefApply
-fields [list $addLoc]
-callback {for {set a 1} {$a <= 7} {incr a 1} {
set data $Form(Location($a):value)
puts "$data"}}]
gtAddFields –handle $form –fields [ list $location($a)]}}]
getDisplay -handle $form

谢谢楼上的帮助了,问题是,如果将gtAddFields –handle $form –fields [ list $location($a)]放在getDisplay -handle $form后面的话,那么前面
Set addLoc [gtCreateButton -name addSymbol -buttonText “Add Location”\
-callback {for {set a 1} {$a <= 7} {incr a 1} {
Set location($a) [gtCreatePointField -name Location($a)\
-editable t\
-prompt “Location”\
-value (0,0)\
-defValue (0,0) ]}]
的执行按钮就无法callback一个可见的PointField

等高手解决...
弱弱的问一句,请问小编解决了么?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top