Kuja 发表于 2003-5-28 21:12:00

我用popup_list ,为什么选第一个无效??

详细:
(new_dialog "gear" (load_dialog "gear.dcl"))
      (start_list "mod")   
      (setq modshu '("1" "1.25" "1.5" "2" "2.5" "3" "4" "5" "6" "8" "10" "12" "16" "20" "25" "32" "40" "50"))
      (mapcar 'add_list modshu)
      (end_list)

      (action_tile "mun" "(setq n1 $value)")
(action_tile "mod" "(setq mod1 $value)")
(action_tile "hight" "(setq gh1 $value)")
(action_tile "d" "(setq d11 $value)")
(start_dialog)
(if (= 0 (start_dialog))
       (setq   mod2 (atoi mod1)
               od (nth mod2 modshu)
               mod (atof od)
               n (atoi n1)
               gh (atof gh1)
                 d1 (atof d11)
                       )
                  )

dcl文件:
gear:dialog {
label="齿数";
:edit_box {
label="输入齿数";
key="mun";
edit_width=8;
}
:popup_list {
label="模数";
key="mod";
edit_width=8;
}
:edit_box {
label="厚度";
key="hight";
edit_width=9;
}
:edit_box {
label="小圆半径";
key="d";
edit_width=9;
}
ok_button;
}

Kuja 发表于 2003-5-28 21:18:00

每次

每次选首先选1 都会有error: bad argument type: stringp nil

选2或者之后的就没有问题,在选1也没问题,但是那个mod的值是前一次选的值
大家帮忙看看~~谢谢

Kuja 发表于 2003-5-28 21:23:00

我有新发现

就算第一次选1 都要点一下下拉菜单,再选1
就有效

meflying 发表于 2003-5-29 08:48:00

因为你是在(action...)中给MOD1付值的,如果不点,就没有动作,MOD1为空,就出错。

建议你在编程是做一些出错处理,比如调用对话框失败、付值未符合要求等的错误处理
页: [1]
查看完整版本: 我用popup_list ,为什么选第一个无效??