![]() |
Lumiera 0.pre.04
»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 size_t | size_type |
| typedef Gtk::Widget | value_type |
| typedef Gtk::Widget & | reference |
| typedef Gtk::Widget const & | const_reference |
| using | iterator = IterType |
| using | const_iterator = ConstIterType |
Private Member Functions inherited from ScopedPtrVect< Gtk::Widget > | |
| ~ScopedPtrVect () | |
| ScopedPtrVect () | |
| ScopedPtrVect (size_type capacity) | |
| ScopedPtrVect (ScopedPtrVect &&src) | |
| ScopedPtrVect & | operator= (ScopedPtrVect &&other) |
| Gtk::Widget & | manage (Gtk::Widget *obj) |
| take ownership of the given object, adding it at the end of the collection | |
| Gtk::Widget * | detach (void *objAddress) |
| withdraw responsibility for a specific object. | |
| void | clear () |
| Gtk::Widget & | operator[] (size_type i) |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| size_type | size () const |
| size_type | max_size () const |
| size_type | capacity () const |
| bool | empty () const |
|
inline |
Definition at line 133 of file test-control.hpp.
References ScopedPtrVect< Gtk::Widget >::manage().
Referenced by TestControl::TestControl().
Here is the call graph for this function:
Here is the caller graph for this function:
Inheritance diagram for Notebook:
Collaboration diagram for Notebook: