I’m trying to lay out a dialog and normalisation isn’t working the way I 
expect. I’m using a normaliser ‘norm’ for all buttons and labels, but they’re 
coming out different sizes in different parts of the dialog… Test code to 
demonstrate the problem below, cut down from a much larger dialog. Environment 
is Lua 5.1 on windows, iup 3.5 – I have no control over the lua or iup versions.

 

I suspect I’ve got a fundamental misunderstanding of how this is supposed to 
work.

 

Helen

 

require("iuplua") -- GUI

norm = iup.normalizer{}

function MakeButton(title)

    return iup.button{alignment="ALEFT",padding ="10x2",normalizergroup = norm, 
title = title}

end

function MakeList(values)

    local l = iup.list{sort="NO", dropdown="YES", 
expand="HORIZONTAL",visibleitems="5"}

    for i, v in ipairs(values) do

        l[tostring(i)]=v

    end     

    return l

end

function MakeText()

    return iup.text{visiblelines = "1", padding ="10x2", expand = "HORIZONTAL"}

end

function MakeLabel(title) 

    return iup.label{title = title, normalizergroup = norm}

end

 

function boxA()

    local tblAssessment = {"Unreliable", "Questionable", "Secondary Evidence", 
"Primary Evidence", "<clear assessment>" }

    return iup.expander{title="A", state = "OPEN", 

        iup.vbox{

            iup.hbox{

                iup.hbox{MakeButton("Date..."), MakeText(); alignment = 
"ACENTER"},

                iup.hbox{MakeLabel("Assessment"), MakeList(tblAssessment); 
alignment = "ACENTER"}

            }

        }

    }

end

 

function boxB()

    return iup.expander{title="B", state = "OPEN",

        iup.vbox{

            iup.hbox{

                iup.hbox{MakeButton("Date..."), MakeText(); alignment = 
"ACENTER"},

                iup.hbox{MakeButton("Age..."), MakeText(); alignment = 
"ACENTER"}

            }

        }

    }

end

 

dlgmain = iup.dialog{iup.vbox{boxA(),boxB()}}

dlgmain.title = "Test"

dlgmain.size="QUARTER"

dlgmain.expand="YES"

dlgmain.margin = "3x3"

dlgmain.cgap = "2"

dlgmain.expandchildren = "YES"

norm.normalize = "HORIZONTAL" iup.Destroy(norm)

dlgmain:show()

iup.MainLoop()

dlgmain:destroy()

_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to