如何在 IUP 中从现有元素(如框架、按钮或标签)派生新的 GUI 元素。我在 Debian Linux 上使用 Lua 语言工作。我尝试了以下操作,但它们不起作用:
MyButton = iup.button{title="", size="40x40"}:new()
错误是:
attempt to call method 'new' (a nil value)
IupButton:new()
也不起作用。
我尝试检查不同的站点,例如http://webserver2.tecgraf.puc-rio.br/iup/、https://webserver2.tecgraf.puc-rio.br/iup/en/iuplua_adv.html和https://metacpan .org/pod/distribution/IUP/lib/IUP.pod但找不到该方法。
如何在 IUP 和 Lua 中创建派生类?