Hello,

I am not able to make the grid work. Labels dont get the same width.

--------------------gridtest.lua
require"iuplua"
require("iupluacontrols")

telems = {
{"perlinfac",2.6,iup.val,{min=0,max=10}},
{"perlindistfac",0.023,iup.val,{min=0,max=0.1}},
{"plane_angle",0,iup.dial,{orientation="CIRCULAR"}},
{"angle",0,iup.dial,{orientation="CIRCULAR"}}
}

local elems = {}
for i,elem in ipairs(telems) do
    local name = elem[1]
    local inival = elem[2]
    local verb = elem[3]
    local args = elem[4] or {}
    
    local label = iup.label{title=name}
    local labelval = iup.label{title=string.format("%.3f",inival)} 
    local ctrl = verb(args)
    ctrl.expand = "YES"
    ctrl.value = inival
    
    table.insert(elems,label)
    table.insert(elems,ctrl)
    table.insert(elems,labelval)
end

local butreset = iup.button{title="Reset"}
local butsave = iup.button{title="Save"}
local butload = iup.button{title="Load"}
local butbox = iup.hbox{butreset,butload,butsave}

local grid = iup.gridbox(elems)
grid.NUMDIV = 3
grid.sizecol = 1 

local content = iup.vbox{grid,butbox}
content.ALIGNMENT ="ACENTER"

dialog = iup.dialog{content,title=title,topmost="YES"}
dialog:showxy(0,200)

iup.MainLoop()
--------------------

Thanks

victor

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to