Lumiera  0.pre.03
»edit your freedom«
Notebook Class Reference

#include "stage/dialog/test-control.hpp"

Description

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.

  • define the pages as custom widgets, typically just as locally known struct types
  • invoke #buildPage passing the type and tab label for each page
  • define the wiring of the components within a page in the page's ctor
  • possibly pass external dependencies for wiring into that ctor
    Note
    the page widgets are actually heap allocated and managed automatically
    See also
    stage::dialog::TestControl as a usage example

Definition at line 135 of file test-control.hpp.

Public Member Functions

template<class PAG , typename... ARGS>
NotebookbuildPage (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
 
+ Inheritance diagram for Notebook:
+ Collaboration diagram for Notebook:

The documentation for this class was generated from the following file: