萝卜L

导航

iup "creation only"的时刻

iup[lua]中某些属性限定了"creation only"。
经测试,"creation only"在map前(map_cb前)即可(无需在如iup.dialog{}iup.text{}调用时)。

local iup=require'iuplua'
local Method='before map'
--	and 'after map'
local Text=iup.text{
	map_cb=function(Text)
		if Method=='after map' then
			Text.BORDER='YES'
			Text.SPIN='YES'
		end
	end,
}
if Method=='before map' then
	Text.BORDER='YES'
	Text.SPIN='YES'
end
local Dialog=iup.dialog{
	SIZE='100x',
	Text,
	map_cb=function(Dialog)
		if Method=='after map' then
			Dialog.MINBOX='NO'
			Dialog.MAXBOX='NO'
		end
	end,
}
if Method=='before map' then
	Dialog.MINBOX='NO'
	Dialog.MAXBOX='NO'
end
iup.Show(Dialog)
iup.MainLoop()

posted on 2025-07-13 14:18  萝卜L  阅读(9)  评论(0)    收藏  举报