Skip to content

Constraining size based on other views #855

@electricbrass

Description

@electricbrass

This is maybe a feature request, but more of just a question about using the library:
I have a fixed sized view here on the right, and a full with .full_width() on the left:

Image

It works great. I can resize the window and the small column never gets wider, while the resizes to fit the screen.

...until something wider than the TextView gets appended

Image

Then it grows until it takes the entire width of the screen before wrapping.

I can't figure out how I'm supposed to constrain it's size properly. AtMost and Fixed both require an actual value, which I haven't figured out a way to dynamically find. I tried adding a callback to Event::Refresh or Event::WindowResize than uses siv.screen_size().x and change the max_width of that view, but everything I've tried either results in the callbacks never running, or getting a screen width of 0.

I just want it to take up the entire screen minus the width of any fixed size views.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions