我使用的是Lua 5.1.4和IUP 3.4.0。
给定代码:
dlg = iup.dialog {
iup.hbox {
iup.tabs {
tab1,
tab2
}
}
;
title = "window",
rasterSize = "640x480"
}当tab1和tab2都是包含一个或多个元素的iup.hbox时,如何让iup.tabs元素占据整个窗口?
发布于 2013-05-12 09:53:35
你的解决方案并不完全是一个黑客。实际上是在指向正确的方向。iup.fill{}元素可用于执行此操作,它是一个执行此操作的空元素。但由于它只在盒子的方向上展开,因此解决方案将如下所示:
tab1 = iup.hbox {
iup.button { title = "A button" },
iup.fill { },
iup.vbox{iup.fill { }}
;
tabtitle = "Tab1"
}发布于 2013-05-12 09:02:00
经过一些实验后,对我有效的解决方案是在其中一个选项卡中插入一个不可见的标签元素,如下所示。
require( "iuplua" )
tab1 = iup.hbox {
iup.button { title = "A button" },
iup.label { expand = "yes" }
;
tabtitle = "Tab1"
}
tab2 = iup.hbox {
iup.button { title = "Another button" }
;
tabtitle = "Tab2"
}
dlg = iup.dialog {
iup.hbox {
iup.tabs {
tab1,
tab2
}
}
;
title = "window",
rasterSize = "640x480"
}
dlg:showxy( iup.CENTER, iup.CENTER )
iup.MainLoop()对我来说,这感觉像是一个黑客,我相信有一种更干净的方式存在。
https://stackoverflow.com/questions/16502337
复制相似问题