On 06-06-2019 02:33, Alex X wrote:
On Wed, 5 Jun 2019 22:47:49 +0200, Mike Wey wrote:
On 04-06-2019 23:59, Alex X wrote:
On Tue, 4 Jun 2019 19:59:13 +0200, Mike Wey wrote:
I'm not entirely sure if i am following you.
But what happens when you set the
shrink
child property of the Box to
true?paned.childSetProperty(box, "shrink", new Value(true));
Unfortunately it does not work ;/
With a paned it crashes, if I use the parent box it does not crash but seems to have no effect. Does every child of of the one I want to shrink need to have the property set?
This would be the same as passing the value when calling packStart.
I simply have a gtkBox, 3 rows. The first row is fixed in size, the second row's size should vary from 0 to 100 depending on how much space. Last last row should take up any remaining space.
the gtkBox can grow in size over all set by the user.
It's sort of like a drop down box.It fact, it really has nothing to do with a paned, I suppose. That is a top level container that lets me size the boxes.
It's simply that I have a 3-Box and the 3rd row should shrink down to 0 before the two top boxes are shrunk.
It's also can be thought of as a 2-box.
[[[Row 1]]] [[[Row 2]]]
Row 1's height can vary. Row 2's height can vary. The overall box containing these will change based on the outside. It's height is H.
The height is split up between row 1 and row 2.
Min max of row 1 is 0 and 100, min max of row 2 is 0 and infinity(or screen height)
I always want row 1 to dominant row 2. If H <= 100 then row 1 is only shown and row 2 is completely hidden. If H > 100, say, 110 then row 2's height is 10, if H = 300 then row 2's height is 300-100 = 200.
If H = 30, row 1's height is 30, row 2's height is 0.
the formulas would be
row1Height = min(100, max(0, H))
row2Height = max(0, H - row1Height)e.g., if H = 200 then
row1Height = min(100, max(0, 200)) = 100
row2Height = max(0, H - row1Height) = 100And they are split evenly,
but if H = 100, then
row1Height = min(100, max(0, H)) = 100
row2Height = max(0, H - row1Height) = 0But what is happening is that when H <= 100, the height is split evenly, which I don't want.
I end up with
row1Height = 50
row2Height = 50and row1height + row2Height = H.
That is the default algorithm, I suppose, equally distributing the height among the children but it is not what I want. I'm not sure how to get it to work.
I see what you are trying to do, no solution yet though.
Is there any way to modify the way the children are arranged in a box without creating an entirely new class?
Or, is there a away to create a derived class easily?
e.g.,
class NewBox : Box
{Box OldBox; override arranger.... this(Box box) { OldBox = box; } // Dispatches everything to old box except arranger Wrap!(Box, OldBox);
}
oldBox = new NewBox(box);
The idea is to just modify the behavior we want for the box and let everything else get dispatched back to the original.
while gtkd.Implement.ImplementClass
would allow you to do just that, i
believe the function that determines the size isn't virtual.