如何在 IupAnimatedLabel 中显示循环进度 IUP_CircleProgressAnimation
how to display circular progress IUP_CircleProgressAnimation in IupAnimatedLabel
这是最小的工作代码:
require("iuplua")
require( "iupluacontrols" )
require("iupluaimglib")
label_1 = iup.label {title = "The label "}
label_2 = iup.label {image = "IUP_ActionOk"}
-- NOT WORK
--label_3 = iup.AnimatedLabel(NULL);
--iup.SetAttribute(label, "ANIMATION", "IUP_CircleProgressAnimation");
--iup.SetAttribute(label, "START", "Yes");
vbox = iup.vbox{
label_1
,label_2
--, label_3
}
dlg = iup.dialog{
vbox
}
dlg:showxy(iup.CENTER,iup.CENTER)
dlg.usersize = nil
-- to be able to run this script inside another context
if (iup.MainLoopLevel()==0) then
iup.MainLoop()
iup.Close()
end
例子是从帮助里拿来的,遗憾的是,注释的-不起作用
使用此代码:
label_3 = iup.animatedlabel{}
label_3.animation = "IUP_CircleProgressAnimation"
label_3.start = "Yes"
刚刚测试,您的示例有效。
这是最小的工作代码:
require("iuplua")
require( "iupluacontrols" )
require("iupluaimglib")
label_1 = iup.label {title = "The label "}
label_2 = iup.label {image = "IUP_ActionOk"}
-- NOT WORK
--label_3 = iup.AnimatedLabel(NULL);
--iup.SetAttribute(label, "ANIMATION", "IUP_CircleProgressAnimation");
--iup.SetAttribute(label, "START", "Yes");
vbox = iup.vbox{
label_1
,label_2
--, label_3
}
dlg = iup.dialog{
vbox
}
dlg:showxy(iup.CENTER,iup.CENTER)
dlg.usersize = nil
-- to be able to run this script inside another context
if (iup.MainLoopLevel()==0) then
iup.MainLoop()
iup.Close()
end
例子是从帮助里拿来的,遗憾的是,注释的-不起作用
使用此代码:
label_3 = iup.animatedlabel{}
label_3.animation = "IUP_CircleProgressAnimation"
label_3.start = "Yes"
刚刚测试,您的示例有效。