WebView on OSX size to fit window? #1305
Unanswered
hoffenmerCode
asked this question in
Q&A
Replies: 1 comment 3 replies
-
What you're requesting isn't possible. Toga's layout algorithm doesn't take the content of the Webview into account when computing the size of the webview - because the web content itself will be laid out based on the amount of space the web view provides. This is a fundamental property of HTML, so it's not something Toga is in a position to work around, either. So - you need to specify a size for the webview. Toga will provide a minimum size (which you can override with min_width and min_height style directives); but fundamentally you need to provide the size. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Writing my own HTML code to be displayed by toga inside a Box which is part of a splitContainer.
The code below results in the 'manually' fitting the HTML file to the exact size of the box (500,500).
When I remove the width and height definition below the HTML view is tiny (50,50) by default.
I tried using flex=1, doesn't work.
Is there a way to define a "Box" and have its content fill the box 100% without needing to define the actual width/height?
`html_view = toga.WebView(url="file:///Users/******/Projects/Beeware/MaSE/sample_html.html", style=Pack(flex=1, width=500, height=500))
containerE_html = toga.Box(style=Pack(flex=1), children=[
html_view
])
Beta Was this translation helpful? Give feedback.
All reactions