Skip to content
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

Fix dependence on Widget#screen #23

Open
docelic opened this issue Apr 8, 2023 · 0 comments
Open

Fix dependence on Widget#screen #23

docelic opened this issue Apr 8, 2023 · 0 comments

Comments

@docelic
Copy link
Collaborator

docelic commented Apr 8, 2023

Widgets have a parent-children hierarchy.

However, the top-level widget has parent = nil, and instead it has a screen to which it is attached.

In Blessed, Screen is a widget; in Crysterm it is not.
Because of that, there is a new method parent_or_screen which is guaranteed to return something.

However, because screen must be known for various purposes, directly at the time of widget creation, screen is determined and set.
Also, on adding children to parent, parent's screen value is set on all children.

This is an unclean implementation. Reduce reliance on Widget#screen and in general see how this should be done in a proper way.

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

No branches or pull requests

1 participant