Clarify first section of module docs #4259
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A reddit user posted a question to r/rust, which expressed a confusion in how to get an
ActiveEventLoop, so that they could useActiveEventLoop::create_window(), when the docs only showed how to create anEventLoop.I read through and replied to help them understand the relationship between
EventLoop,Window,ActiveEventLoop, andApplicationHandler, but I felt that the first-seen docs at the top of the user-facingwinitmodule were a bit confusing. Specifically, talking about how to create aWindowwith seemingly no example of how to do so (the example later in the Event Handling section seemed disconnected), and linking toActiveEventLoop::create_window()after only talking aboutEventLoopfelt odd and confusing, which is what the original user seemed to struggle with.I reordered a few docs and added a 2-paragraph rundown of the core API Architecture, which I believe would have prevented both my initial confusion, and the confusion of the original poster on reddit.
Full disclosure, I have never actually seen
winitcode or its API docs before, I just benefit from it indirectly when it's used to create tools which I do use. I felt I could help with the docs so I gave a shot. Feel free to make suggestions or edits, or to simply close the PR if this is not wanted. I'm happy to follow this through if changes need to be made.Tested on all platforms changedAdded an entry to thechangelogmodule if knowledge of this change could be valuable to usersUpdated documentation to reflect any user-facing changes, including notes of platform-specific behaviorCreated or updated an example program if it would help users understand this functionality