Skip to content

Add content argument to WebView instantiation #2851

@hyuri

Description

@hyuri

What is the problem or limitation you are having?

Similar to #2307

Right now, unlike with URL, to create a WebView and set [HTML] content to it, we have to do it in two steps:

web_view = toga.WebView()

web_view.set_content("", html_content)

Describe the solution you'd like

WebView already allows passing a URL during instantiation, so why not allow passing "content" as well? That way we can do it in one step, and be consistent with MainWindow and ScrollContainer:

web_view = toga.WebView(content=html_content)

Describe alternatives you've considered

None

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features, or improvements to existing features.good first issueIs this your first time contributing? This could be a good place to start!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions