[Iup-users] no scrollbars (matrix)
Antonio Scuri
scuri at tecgraf.puc-rio.br
Wed Oct 31 21:23:22 GMT+3 2007
Ok. Now I can see the problem.
I don't know what the expected behavior when the matrix was implemented.
But I will try to figure it out and at least document it. I'll get back to
you in a few days.
Thanks for reporting this.
Best,
scuri
_____
From: iup-users-bounces at lists.luaforge.net
[mailto:iup-users-bounces at lists.luaforge.net] On Behalf Of Philippe Quesnel
Sent: quarta-feira, 31 de outubro de 2007 14:48
To: IUP discussion list.
Subject: Re: [Iup-users] no scrollbars (matrix)
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
<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/6f8a1a8b/attachment.html
More information about the iup-users
mailing list