Skip to content

docs: clarify how to create windows from ActiveEventLoop#4572

Open
tatakaisun wants to merge 1 commit into
rust-windowing:masterfrom
tatakaisun:docs/clarify-active-event-loop-window-creation
Open

docs: clarify how to create windows from ActiveEventLoop#4572
tatakaisun wants to merge 1 commit into
rust-windowing:masterfrom
tatakaisun:docs/clarify-active-event-loop-window-creation

Conversation

@tatakaisun
Copy link
Copy Markdown

Fixes #3877.

Reproduction

The crate-level "Building windows" documentation currently shows creating an
EventLoop, then immediately says to create a Window with create_window.
That skips the step where users obtain an ActiveEventLoop, which is the value
that actually exposes create_window.

Why this is a small fix

The existing example already creates the window from an ApplicationHandler
callback. This PR only adds the missing explanation: EventLoop::run_app()
launches the loop and passes an ActiveEventLoop to the handler callbacks, and
that active event loop should be used to create the window.

Backward compatibility

This is documentation-only. No API, behavior, examples, or runtime code are
changed.

Checks

  • cargo check -p winit passed
  • cargo test -p winit --doc passed
  • cargo fmt --check fails due to existing formatting / rustfmt configuration unrelated to this docs-only change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Documentation doesn't explain how to create an ActiveEventLoop

1 participant