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

Child views ? #162

Open
MichaelMure opened this issue Aug 3, 2018 · 0 comments
Open

Child views ? #162

MichaelMure opened this issue Aug 3, 2018 · 0 comments

Comments

@MichaelMure
Copy link

I feel like it would help a lot in complex UI to be able to parent views to another view. That would mean that:

  • DeleteView would delete the child views as well, and thus disable the associated keybindings
  • SetViewOnTop and SetViewOnBottom would move children as well
  • View positions would be expressed relatively to the parent view. Apart from simplifying the code to position these view, it would also mean that moving or scrolling the parent view would move the children
  • Child view would only be able to render inside the parent's area.

I came to think about that because I want to implement a scrolling page with many block of information. With the current gocui I can either:

  • render everything in a single view as text and scroll it with SetOrigin, but:
    • i can't easily use frames around my blocks
    • I have to render everything in the buffer so perf might suffer
    • I can't use keybindings for my blocks or any helping feature of gocui like text wrapping
  • generate views for each blocks and manually deal with it, but:
    • scrolling become harder to implement
    • I need custom logic to not generate/render views that are outside of the scrolling area
    • clipping of the render of a block has to be done by having other views around the area to be on a higher layer which might not be convenient or easy to maintain depending on the situation
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