Skip to content

Fix dependence on Widget#screen #23

@docelic

Description

@docelic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions