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
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 keybindingsSetViewOnTop
andSetViewOnBottom
would move children as wellI 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:SetOrigin
, but:gocui
like text wrapping