Skip to content

Conversation

@rodrigogiraoserrao
Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao commented Aug 9, 2023

See relevant issue: #3076.
Some methods need to be implemented to make the widget work but the user doesn't really care about them. For that matter, we can hide them from the public documentation.

I decided to hide these methods that some widgets inherit and document:

  • "compose"
  • "render"
  • "render_line"
  • "render_lines"
  • "get_content_width"
  • "get_content_height"
  • "on_mount"

On a case-by-case basis, we may also want to hide specific methods from specific widgets, but that probably entails manually curating such a list of excluded methods.

See relevant issue: #3076.
Some methods need to be implemented to make the widget work but the user doesn't really care about them. For that matter, we can hide them from the public documentation.
@rodrigogiraoserrao rodrigogiraoserrao linked an issue Aug 9, 2023 that may be closed by this pull request
@willmcgugan
Copy link
Member

That looks right. Although for the case of on_mount and other handlers, we can make those private with an underscore. Textual will still call those handlers, and don't need to worry about excluding them.

@rodrigogiraoserrao
Copy link
Contributor Author

[...] for the case of on_mount [...] we can make those private with an underscore.

Of course. Updated.

@willmcgugan willmcgugan merged commit fbe1c41 into main Aug 15, 2023
@willmcgugan willmcgugan deleted the hide-protocol-methods branch August 15, 2023 15:53
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.

Remove docstrings from "protocol" methods

2 participants