- 0
- 0
- 约2.19万字
- 约 18页
- 2026-01-27 发布于北京
- 举报
3.7.1通用
通过语句importkcs_ui,这些函数在Python程序中可用。然后,这些
函数被为kcs_ui.函数名。在使用新函数之前,请仔细阅读函数描述。
VitesseUI接口支持以下简单的用户界面函数:
•在Tribon应用程序的图形显示中执行交互式指示
•以与Tribon应用程序本身相同的方式弹出框
•应用程序窗口最大化、最小化、刷新显示等
函数中返回的值“UserResponse”应通过Utility接口中的适当函数进行检
查。通常情况下,当用户完成输入时,会返回kcs_util.ok();而其他响应如
kcs_util.cancel()和kcs_util.quit()则表示特定的用户中断。
注意:UserResponsekcs_util.ok()不应与函数answer_req进行比较。
在通用的Python编程环境中,还有高级的用户界面工具可用。一个这样
的工具示例是wxPython,可以从。
3.7.2异常处理
VitesseUI接口使用异常处理。这意味着如果发生运行时错误,将设置一个异
常。可以使用Python语言的“try‑except”结构捕获该异常。然后,可以通过
检查kcs_ui.error的值来确定错误类型。异常也会被写入Vitesse日志。异常
的含义可以在相应函数的文档中找到。
默认错误是kcs_Error。请注意,kcs_Error异常是一个通用异常,下面将不
再详细描述。
示例:importkcs_uimsg=请输入一个位
置coord=KcsPoint2D.Point2D()try:res=
kcs_ui.point2D_req(msg,coord)except:
3.7.1General
ThefunctionsaremadeavailableinthePythonprogrambytheinsertionofthe
statementimportkcs_ui.Thefunctionsarethenreferredtoaskcs_ui.functionname.
Beforeusinganewfunction,pleasecarefullyreadthefunctiondescription.
TheVitesseUIInterfacesupportsthefollowingsimpleUserInterfacefunctions:
•PerforminteractiveindicationinthegraphicaldisyoftheTribonapplication
•PopupdialogueboxesinthesamewayastheTribonapplicationitselfuses.
•Applicationwindowize,minimize,refreshdisyetc.
ThereturnedvalueUserResponseinthefunctionsshouldbecheckedagainstaproper
functionintheUtilityinterface.Normally,theUserResponsekcs_util.ok()isreturned
whentheuserhascompletedtheinput,whileotherresponseslikekcs_util.cancel(),
kcs_util.quit()givesthespecificuserinterruption.
Note:thattheUserResponsekcs_util.ok()should
您可能关注的文档
最近下载
- 普通心理学 第六章 记忆(课件).ppt VIP
- 地理峦头精语录1.doc VIP
- 施工设备租赁安拆、配套服务招标文件.doc VIP
- AP英语语言和写作 2022年真题 附答案和评分标准 AP English Language and Composition 2022 Real Exam with Answers.pdf VIP
- 新型储能项目建设预算编制与计算规定(锂离子电池储能电站分册).docx
- 挖掘机自检报告模板.docx VIP
- 2026年高考作文备考之10组正反面论证及人物素材.docx VIP
- 建筑工程质量、安全生产管理制度建筑工程质量管理体系及制度.docx
- 12D9 室外电缆工程_标准图集.pdf VIP
- 2026福建水投大田水务招聘3人考试重点试题附答案解析.docx VIP
原创力文档

文档评论(0)