Discussion:
[Foxgui-users] Fix the widt of columns in FXMatrix
woodchuck
2016-11-26 17:26:44 UTC
Permalink
Dear all,

i am wondering how to set the column width for FXMatrix. I want to align
the width of the first column in two separate FXMatrix objects, the
first one with two, the second with three columns.

In the first Column i want to place an FXLabel.

Can i fix the width of a FXMatrix column or must i do the Layout for
each "matrix" as following pseudocode:

FXHorizontalFrame hf;
FXSpring s1(hf, width2);
FXSpring s2(hf, width2);
FXVerticalFrame vf1(s1, ...);
FXVerticalFrame vf1(s1, ...);
FXLabel(vf1,...);

Thanks
Tom
JVZ
2016-11-28 13:57:27 UTC
Permalink
On Sat, 26 Nov 2016 18:26:44 +0100
Post by woodchuck
Dear all,
i am wondering how to set the column width for FXMatrix. I want to align
the width of the first column in two separate FXMatrix objects, the
first one with two, the second with three columns.
In the first Column i want to place an FXLabel.
Can i fix the width of a FXMatrix column or must i do the Layout for
Generally, you set the width of the children of an FXMatrix, not a column or
row of FXMatrix. You can of course set the width of FXMatrix itself.

In your case, in order to line everything up I would suggest to peg one of
the children in a column of the first and two in columns of the second matrix.

As a general guideline, I recommend against pinning sizes of things, just in
case one were to change fonts or text labels [unless the items are fixed size
by their nature, e.g. icons or images].

A good alternative to prevent things from getting too small is to add a dummy
widget in there somewhere, like e.g. a borderless FXFrame with a pinned size
to prevent things from getting too small.

A few dummy widgets in a column is incidentally also a good suggestion for
emulating a matrix with variable number of columns.


Hope this helps,

-- JVZ


+----------------------------------------------------------------------------+
| Copyright (C) 14:40 11/22/2016 Jeroen van der Zijp. All Rights Reserved. |
+----------------------------------------------------------------------------+

------------------------------------------------------------------------------
Loading...