问题描述:

3.8.9编码版中运行正常的打开自定义对话框代码在3.9.9版本显示不正常

解决方案:

在控件配置项中增加”value”字段(默认值),否则会报错
并增加”dialogTitle”字段,否则会弹出四个按钮

  1. import xbot
  2. from xbot import print, sleep, app
  3. from .import package
  4. def main(args):
  5. custom_dialog=app.dialog.show_custom_dialog({
  6. "dialogTitle":"title",
  7. "settings": {
  8. "editors": [
  9. {
  10. "type": "TextBox",
  11. "label": "输入框",
  12. "VariableName": "TextBox",
  13. "value": None,
  14. "nullText": "请输入文本内容"
  15. }
  16. ],
  17. "buttons": [
  18. {
  19. "type": "Button",
  20. "label": "确定",
  21. "theme": "red",
  22. "hotKey": "Return"
  23. },
  24. {
  25. "type": "Button",
  26. "label": "取消",
  27. "theme": "white",
  28. "hotKey": "Escape"
  29. }
  30. ]
  31. }
  32. }
  33. )