IupLua - Position component

2

In IUPLua, how do I position a component indicating X (horizontal position) and Y (vertical position)? I read in the documentation:

  

It will be changed during the layout computation, except when   FLOATING = YES or when used inside a concrete layout container.

Then I tried:

require "iuplua"
button = iup.button{title="button", floating="yes", position = "50,0"}
dlg = iup.dialog{title="test", size="QUARTERxQUARTER", button}

dlg:show()

iup.MainLoop()

But it does not change anything.

    
asked by anonymous 08.01.2015 / 17:24

2 answers

2

FLOATING is an attribute processed only by abstract layout boxes, such as vbox and hbox . That's why your code did not work. In your example, doing , iup.vbox{button}} starts working.

If you want to do concrete layout with IUP then it is best to use iup.cbox as container . In this case the example should be modified like this:

floating="yes", cx = 50} 

, iup.cbox{button}}
    
08.01.2015 / 17:59
2

I have. To get position, I had to put the button inside a box (I used hbox), and set the FLOATING attribute of the button to "yes". Here is the code:

require "iuplua"
button = iup.button{title="button", floating="yes", position = "50,0"}
dlg = iup.dialog{title="test", size="QUARTERxQUARTER", iup.hbox{button}}

dlg:show()

iup.MainLoop()

It looks like this:

    
08.01.2015 / 17:54