Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/dialog/test-control.hpp"
Helper widget to simplify construction and wiring of a [Notebook] widget.
Gtk::Notebook is quite powerful container foundation to build complex dialog widgets with multiple pages on tabs. However, the construction, wiring and setup is notoriously tedious, due to the repetitiveness and the sheer amount of child widgets spread over various pages.
This design draft is an attempt to mitigate the required boilerplate, without overly much obscuring the structure. The basic idea is to package each page into a locally defined child struct, which is actually heap allocated and managed automatically. This way, each child page gets its own namespace, and wiring to other components is made explicit by passing named ctor arguments – while the overall structure of building and wiring of widgets stays close to the habits of programming with GTKmm.
Definition at line 126 of file test-control.hpp.
Public Member Functions | |
template<class PAG , typename... ARGS> | |
Notebook & | buildPage (cuString pageLabel, ARGS &&...ctorArgs) |
Additional Inherited Members | |
Private Types inherited from ScopedPtrVect< Gtk::Widget > | |
typedef ConstIterType | const_iterator |
typedef Gtk::Widget const & | const_reference |
typedef IterType | iterator |
typedef Gtk::Widget & | reference |
typedef size_t | size_type |
typedef Gtk::Widget | value_type |
Private Member Functions inherited from ScopedPtrVect< Gtk::Widget > | |
ScopedPtrVect (size_type capacity) | |
iterator | begin () |
const_iterator | begin () const |
size_type | capacity () const |
void | clear () |
Gtk::Widget * | detach (void *objAddress) |
withdraw responsibility for a specific object. More... | |
bool | empty () const |
iterator | end () |
const_iterator | end () const |
Gtk::Widget & | manage (Gtk::Widget *obj) |
take ownership of the given object, adding it at the end of the collection More... | |
size_type | max_size () const |
Gtk::Widget & | operator[] (size_type i) |
size_type | size () const |