Multiple object containers in ruby rbcurse
I’ve introduced a simple container called MultiContainer. One can add multiple components to it, and it displays on component at a time. One can then cycle through components, add and delete components etc.
These components could be different widgets such as textareas, tables, lists etc.
An example of where one might use this is again a kind of SQL client in which there are several resultsets. One can create a TabbedPane with tabs for each resultset, or a MultiContainer with textviews. Currently, since the components can be editable, I’ve mapped
M-: to the menu which gives options for iterating, listing, deleting components. M-: is a little cumbersome, so I might change it later.
I find MultiContainer and MultiTextView to be simple containers unlike TabbedPane which is quite involved. So its light, simple to setup and easy to maintain. These 2 containers allow us to save a lot of screen space.
For a demo of this, please see examples/testmulticomp.rb