|
楼主 |
发表于 2025-3-5 15:15:26
|
显示全部楼层
import xcgui
from xcgui import XApp, XWindow, XDesigner
app = XApp()
XDesigner.loadResource("D:\code\炫彩IDE-3.3.9.1-(2025-01-31)\data\示例\项目模板\第一个窗口程序\resource.res")
class BaiduWindow(XWindow):
def __init__(self):
super(BaiduWindow, self).__init__()
self.loadLayout("D:\code\炫彩IDE-3.3.9.1-(2025-01-31)\data\示例\项目模板\第一个窗口程序\main.xml")
self.btn = self.findObjectByName("按钮1")
self.btn.regEvent(xcgui.XE_BNCLICK, self.onBtnClick)
def onBtnClick(self, event, userdata):
print("点击")
self.findObjectByName("编辑框1").setText("按钮1被点击")
self.findObjectByName("编辑框1").redraw(True)
window = BaiduWindow()
print(window.findObjectByName("按钮1"))
window.showWindow()
app.run()
app.exit() |
|