GUI frame vertical lengh too long

Place to get help with not working mods / modding interface.
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

GUI frame vertical lengh too long

Post by osldgoth »

I have a gui frame with children inside, the frame extends well below the last child. I have not been able to figure out how to shorten the frame.
Cut from the red line down:
picture
code snips
on a side issue (maybe related) I'm not even sure how there are two columns. I used to have the children in a table but have since removed the table. Could each child element be adding to the vertical length?
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

Re: GUI frame vertical lengh too long

Post by osldgoth »

perhaps I have discovered something.
if I remove the caption on the frame the child elements extend to the bottom edge of the frame:
no caption
if I make the caption much longer, the frame becomes wider allowing the child elements to reposition making fewer rows, but the frame height stays the same:
long caption
Is that a bug? my thought is that the frame height would be dynamic like frame width seems to be. or is there some frame setting I need to use?
Helfima
Fast Inserter
Fast Inserter
Posts: 202
Joined: Tue Jun 28, 2016 11:40 am
Contact:

Re: GUI frame vertical lengh too long

Post by Helfima »

If u use a vertical frame, it try put all children in vertical before
2 way for ur problem
Use a table type guielement with 2 column
Or use a horizontal flow for label and button by row
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

Re: GUI frame vertical lengh too long

Post by osldgoth »

Nevermind, I figured it out, all I need to do is have each "sprite-button"/"button" pair add to maximal_height. Once the frame in question is added to the game I'll set the max height to be 50 (aprox height of caption + some padding),
code
after that it's only a matter of adding a number to that each time a child is added. What could go wrong?

Thanks for all the help
Helfima
Fast Inserter
Fast Inserter
Posts: 202
Joined: Tue Jun 28, 2016 11:40 am
Contact:

Re: GUI frame vertical lengh too long

Post by Helfima »

Maximal value is juste for frame display. If u have more child is displayed out of the frame
Post Reply

Return to “Modding help”