Skip to content

Explain self.app in the guide more explicitly [Documentation] #5975

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

edward-jazzhands
Copy link
Contributor

@edward-jazzhands edward-jazzhands commented Jul 21, 2025

Please review the following checklist.

  • [N/A] Docstrings on all new or modified functions / classes
  • [yes] Updated documentation
  • [N/A] Updated CHANGELOG.md (where appropriate)

So a bit of explanation, I noticed from combing through the guide, and from general experience helping people in the Discord server, that the self.app attribute is not explicitly explained anywhere in the guide. I figured a PR would be in order to add an explicit explanation somewhere (If there is already a place in the guide where self.app is actually explained, please do point it out. But I'm pretty sure there is no explanation.)

self.app is used in 3 examples: The first two are in the Screens section, modal01.py and modal02.py (which are two versions of the same example). The third is in the Command Palette section, in the command02.py example.

I figured the place it would make most sense to explain it would be right after its first used in the Screens section. There I added a paragraph that is a normal in-line section of the guide. I thought that was appropriate here, since in my opinion it is fairly essential information pertaining to the example.

I also placed a second admonition in the Command Palette section. That's because Command Providers are not widgets or screens (don't inherit from Message Pump), yet they have the self.app attribute tacked on anyway, and they're I believe one of 2 or 3 Textual objects that also have it added. So I thought an extra admonition here would be appropriate to make it clear that this is not on every Textual object, it was just added on here.

What do you think? I have a feeling this should be explained more explicitly somewhere at least. Happy to change any wording or move stuff around.

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

Successfully merging this pull request may close these issues.

1 participant