-
Notifications
You must be signed in to change notification settings - Fork 826
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
Support easier widget "support classes" importing #1637
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove references to TreeNode from the lazy-loading "widgets" while you are here.
Yup, happy to. Was holding that for a followup PR but if we're happy for the breaking change now that's my preference too. :-) |
This encourages importing it from `textual.widgets.tree` instead, keeping it in line with the other changes made for Textualize#1637. Note this is a breaking change.
This aims to make it clear that a small but significant breaking change has taken place. See Textualize#1637.
|
…ets; it is now available via from textual.widgets.tree import TreeNode. Textualize/textual#1637
This PR implements the suggested solution for the requirement detailed in #1589. Quite simply, for those widgets that have non-widget support classes that the using-developer needs access to, have a parallel non-under-prefixed version of the code that imports and "reexports" the support classes.
As such, all this PR does is implement this approach for the widgets that seen to need it. The only one that required it at the moment was
DataTable
, so thatColumn
andRow
can be seen by the calling code.TreeNode
already had an approach to this but for the sake of completeness I've added parallel support for this newer convention.We may want to think about deprecating
widgets.TreeNode
.