Hi Antonio,

I couldn't test your example  as I'm not running a C devel environment.

However I had a play with the matrix_fittosize.lua example and found
that the required change to add rows or dlg resize is small.
Shrinking, worry about that tomorrow.

I'll consider it "case closed"

Regards,

John

require( "iuplua" )
require( "iupluacontrols" )

mat = iup.matrix {
    numcol=5,
    numlin=3,
    numcol_visible=5,
    numlin_visible=3,
    expand = "NO",        -- <<Leave it to the iup.fill{}
    resizematrix = "no"}

mat:setcell(0,0,"Inflation")
mat:setcell(1,0,"Medicine")
mat:setcell(2,0,"Food")
mat:setcell(3,0,"Energy")
mat:setcell(0,1,"January 2000")
mat:setcell(0,2,"February 2000")
mat:setcell(1,1,"5.6")
mat:setcell(2,1,"2.2")
mat:setcell(3,1,"7.2")
mat:setcell(1,2,"4.6")
mat:setcell(2,2,"1.3")
mat:setcell(3,2,"1.4")

filler=iup.fill{}   --- <<< Separate it out so we have a handle
dlg = iup.dialog{iup.vbox{mat; filler,margin="10x10"}; shrink="yes"}

function dlg:resize_cb(w, h)
        iup.Refresh(dlg)
  mat.rasterwidth1 = nil
  mat.rasterwidth2 = nil
  mat.rasterwidth3 = nil
  mat.rasterwidth4 = nil
  mat.rasterwidth5 = nil
  mat.fittosize = "columns"
print ("Resize")                -- Classic Debugging
print (mat.naturalsize)
print (mat.numlin)

while filler.size ~=nil do      -- Just add more lines until
                                -- the  filler  has no space
    mat.numlin = mat.numlin +1
        mat.numlin_visible = mat.numlin
        iup.Refresh(dlg)
    print("refresh")
end

        return iup.IGNORE
end

dlg:showxy(iup.CENTER, iup.CENTER)

if (iup.MainLoopLevel()==0) then
  iup.MainLoop()
end

require( "iuplua" )
require( "iupluacontrols" )

mat = iup.matrix {
    numcol=5, 
    numlin=3,
    numcol_visible=5, 
    numlin_visible=3, 
    expand = "NO",        -- <<Leave it to the iup.fill{}
    resizematrix = "no"}

mat:setcell(0,0,"Inflation")
mat:setcell(1,0,"Medicine")
mat:setcell(2,0,"Food")
mat:setcell(3,0,"Energy")
mat:setcell(0,1,"January 2000")
mat:setcell(0,2,"February 2000")
mat:setcell(1,1,"5.6")
mat:setcell(2,1,"2.2")
mat:setcell(3,1,"7.2")
mat:setcell(1,2,"4.6")
mat:setcell(2,2,"1.3")
mat:setcell(3,2,"1.4")

filler=iup.fill{}   --- <<< Separate it out so we have a handle
dlg = iup.dialog{iup.vbox{mat; filler,margin="10x10"}; shrink="yes"}

function dlg:resize_cb(w, h)
        iup.Refresh(dlg)
  mat.rasterwidth1 = nil
  mat.rasterwidth2 = nil
  mat.rasterwidth3 = nil
  mat.rasterwidth4 = nil
  mat.rasterwidth5 = nil
  mat.fittosize = "columns"
print ("Resize")                -- Classic Debugging
print (mat.naturalsize)
print (mat.numlin)

while filler.size ~=nil do              -- Just add more lines until the filler 
has no space
    mat.numlin = mat.numlin +1
        mat.numlin_visible = mat.numlin
        iup.Refresh(dlg)
    print("refresh")
end

        return iup.IGNORE
end

dlg:showxy(iup.CENTER, iup.CENTER)

if (iup.MainLoopLevel()==0) then
  iup.MainLoop()
end
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to