-PortGroupUI::PortGroupUI (PortMatrix& m, PortGroup& g)
- : _port_matrix (m), _port_group (g), _ignore_check_button_toggle (false),
- _visibility_checkbutton (g.name)
-{
- int const ports = _port_group.ports.size();
- int const rows = _port_matrix.n_rows ();
-
- if (rows == 0 || ports == 0) {
- return;
- }
-
- /* Sort out the table and the checkbuttons inside it */
-
- _table.resize (rows, ports);
- _port_checkbuttons.resize (rows);
- for (int i = 0; i < rows; ++i) {
- _port_checkbuttons[i].resize (ports);
- }
-
- for (int i = 0; i < rows; ++i) {
- for (uint32_t j = 0; j < _port_group.ports.size(); ++j) {
- Gtk::CheckButton* b = new Gtk::CheckButton;
-
- b->signal_toggled().connect (
- sigc::bind (sigc::mem_fun (*this, &PortGroupUI::port_checkbutton_toggled), b, i, j)
- );
-
- _port_checkbuttons[i][j] = b;
- _table.attach (*b, j, j + 1, i, i + 1);
- }
+ for (int i = 0; i < 2; ++i) {
+ _ports[i].set_type (type);
+
+ /* watch for the content of _ports[] changing */
+ _ports[i].Changed.connect (mem_fun (*this, &PortMatrix::setup));