Page 1 of 1

bugged viewport, frame or loop?

Posted: Thu Nov 23, 2017 4:34 pm
by xavimat
Well, after hours struggling against this, I'm now convinced it's a bug:

I have frames inside a hbox inside a vbox inside a viewport (crazy, yes).

When filling the viewport with a for loop, it gets tired of passing the correct properties and, at some point, it gets tired of passing the actual content of the frames:
screenshot0004.png

Code: Select all

screen test():

    viewport:
        scrollbars "vertical"
        draggable True
        mousewheel True

        has vbox
        xalign .5

        hbox:
            box_wrap True
            spacing 30

            for i in range(15):
                frame:
                    xysize(300, 300)
                    bottom_margin 30
                    label "Frame " + str(i) yalign 0.0
                    text "Qfh fjksdh kjdsh fdkjshf sdhfkjdshfjk sdhf dsk" yalign 0.37
                    textbutton "Textbutton" action NullAction() yalign 1.0

Re: bugged viewport, frame or loop?

Posted: Thu Nov 23, 2017 5:57 pm
by Imperf3kt
Why not just use vpgrid? It seems more appropriate to your needs.

Re: bugged viewport, frame or loop?

Posted: Sat Nov 25, 2017 6:33 am
by xavimat
Thanks for the suggestion!
I'm indeed using vpgrid now and it works well, but:
- I had, at the bottom of the viewport, a big frame with more text (this is the reason for the vbox) and I had to delete it, because vpgrid does not allow elements of different size. So, I lost functionality.
- I wanted to use the box_wrap property, so, if the total width is different, less frames are rendered in every row automatically. With vpgrid I had to dupplicate the screen using "variant", one with vpgrid cols 4 and another with vpgrid cols 1.
- In any case, this is indeed a bug and it's useful to report it. :D

Re: bugged viewport, frame or loop?

Posted: Sat Nov 25, 2017 3:56 pm
by Imperf3kt
You could put other containers inside the vpgrid provided you make sure they're exactly the same width/height.
That way you could size each grid according to your biggest container, and then place other containers inside those to make your smaller versions.

Of course, this is probably not ideal and as you say, it probably won't handle scalability as well.

I agree the above issue indeed sounds like a bug, or at least unintended behaviour.

Re: bugged viewport, frame or loop?

Posted: Mon Nov 27, 2017 5:53 pm
by DragoonHP
Hmm. So I just tested out your code xavimat, and it works perfectly for me. Try the usual Force Recompile and see if it works?

PS: And about an alternative way to do this, you can have a vpgrid of 1 column X rows filled with fixed and each fixed can have three frames. A bit roundabout and as Imperf3kt said, probably won't scale as well.

Re: bugged viewport, frame or loop?

Posted: Mon Dec 04, 2017 10:41 am
by xavimat
DragoonHP wrote: Mon Nov 27, 2017 5:53 pm Hmm. So I just tested out your code xavimat, and it works perfectly for me.
So, this is just in my computer. Thanks. I'll test it in more systems.