[Iup-users] no scrollbars (matrix)
Philippe Quesnel
philippe.quesnel at gmail.com
Wed Oct 31 13:47:56 GMT+3 2007
thank you for the answer / details about layout / sizing.
as far as an example, actually the iupmatrix.lua example from the
documentation has the problem,
here it is, I only added the require()s, iup.MainLoop() & the commented
mat.resizematrix = "YES",
(iuplua 2.6 rc2, lua 5.1, winXP)
require("iuplua51")
require("iupluacontrols51")
mat = iup.matrix {numcol=2, numlin=3,numcol_visible=2, numlin_visible=3,
widthdef=34}
--mat.resizematrix = "YES",
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")
dlg = iup.dialog{iup.vbox{mat; margin="10x10"}}
dlg:showxy(iup.CENTER, iup.CENTER)
iup.MainLoop()
the interesting thing I found out is that with mat.resizematrix = "YES",
when I manually (w. mouse) resize a column so that the matrix becomes wider
than the dialog,
an horizontal scrollbar appears, & from that point, resizing the dialog will
now cause the horizontal scrollbar to also appear.
thank you
Philippe
On 10/31/07, Antonio Scuri <scuri at tecgraf.puc-rio.br> wrote:
>
> > if I have a matrix directly inside a dialog, when resizing
> > the dialog smaller than the matrix, I get scrollbars,
>
> In fact the dialog is not smaller than the matrix. The matrix is smaller
> than the size needed by the number of visible lines/columns. Then the
> matrix
> scrollbars will be displayed.
>
>
> > if I place the matrix inside a h/vbox, ie, doing normal
> > 'layout stuff', I dont get scrollbars anymore.
> > Can I get scrollbars on the matrix, or one of its parent container ??
>
> Yes you can.
>
> When you add the matrix to a h/vbox the layout is different from simply
> using the matrix as child. It will try to fit the box size to its
> contents.
>
> When the size of the dialog is smaller than the contents, it will only be
> able to resize it to smaller values if the matrix size is not set by the
> application.
>
> I mean if you set the SIZE or RASTERSIZE attributes they also work as
> minimum size constrains.
>
> If you want to use some size as the initial size and then be able to
> resize
> it to smaller values than that, then you must reset the matrix size after
> the dialog is displayed, doing "mat.size = nil" for instance.
>
> Abstract layout is very useful but can be confusing. Let me know if you
> could solve your problem.
>
> It also helps when you build a very simple test in Lua to demonstrate
> what's going on.
>
> Best Regards,
> Antonio Scuri
>
>
>
>
>
> _______________________________________________
> iup-users mailing list
> iup-users at lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/iup-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.luaforge.net/pipermail/iup-users/attachments/20071031/67461030/attachment.htm
More information about the iup-users
mailing list