Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containers which create internal panels are always stretchable #22

Open
kengruven opened this issue May 31, 2022 · 2 comments
Open

Containers which create internal panels are always stretchable #22

kengruven opened this issue May 31, 2022 · 2 comments

Comments

@kengruven
Copy link
Contributor

Hello! When I say something like this:

(cond-view
 [@foo? (text "foo is set!")]
 [else (text "no foo here!")])

then internally it will instantiate an if-view%, which in turn calls:

(new gui:panel%
             [parent parent]
             [min-width #f]
             [min-height #f]
             [stretchable-width #t]
             [stretchable-height #t]))

There's no way to inject your own arguments for this panel. That is, if you use a cond-view (or any of the similar containers), you can't have a non-stretchable containee. Even if you have a simple 1-line label (which isn't vertically stretchable), putting it in a cond-view causes it to become vertically stretchable, which is not what I want.

Whenever the library creates secret automatic panels, they should either mimic the layout arguments of their containees, or allow me to explicitly pass arguments for them.

Thanks!

@Bogdanp
Copy link
Owner

Bogdanp commented Jun 1, 2022

Thanks for the report! I think probably the best approach would be for these panels to inherit the stretch values of their children (and vary them when the children change), as you suggest. I'll try to do that soon. In the mean time, if you need a stopgap, it might work to wrap these views in other panels that don't stretch (though maybe that won't work right in every case).

@kengruven
Copy link
Contributor Author

Your stopgap solution works for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants