title: How to handle a "notify::active" signal from a Gtk.Switch? (MVC architecture)
body: <p>I cannot figure out how to handle the <code>notify::active</code> signal of a <code>Gtk.Switch</code>. I'm working with the MVC architecture (pattern) <a href="https://stackoverflow.com/questions/40498549/mvc-with-python3-and-gtk3">suggested here</a>.</p>
  
  <p>The error I got is this:</p>
  
  <p><code>TypeError: _on_switch_serial_toggled() missing 1 required positional argument: 'state'</code></p>
  
  <p>Here's my minimal working example (without a model):</p>
  
  <pre><code>import sys
  import gi
  gi.require_version('Gtk', '3.0')
  from gi.repository import Gtk, Gio, GObject
  
  
  class Application(Gtk.Application):
      def __init__(self):
          app_id = "org.iea.etc"
          flags = Gio.ApplicationFlags.FLAGS_NONE
  
          super(Application, self).__init__(application_id=app_id, flags=flags)
  
      def do_activate(self):
          # c.Controller(m.Model(), v.View(application=self))
          Controller(None, View(application=self))
  
      def do_startup(self):
          Gtk.Application.do_startup(self)
  
  
  class Controller(object):
      def __init__(self, model, view):
          self._model = model
          self._view = view
  
          self._view.connect('switch_serial_toggled',
                             self._on_switch_serial_toggled)
  
          self._view.show_all()
  
      def _on_switch_serial_toggled(self, switch, state):
              if switch.get_active():
                  print('Switch ON')
              else:
                  print('Switch OFF')
  
  
  class View(Gtk.ApplicationWindow):
      __gsignals__ = {
          'switch_serial_toggled': (GObject.SIGNAL_RUN_FIRST, None, ())
      }
  
      def __init__(self, **kw):
          super(View, self).__init__(**kw)
  
          self._switch_serial = Gtk.Switch()
          self._switch_serial.connect("notify::active",
                                      self.on_switch_serial_toggled)
  
          self.add(self._switch_serial)
  
      def on_switch_serial_toggled(self, switch, state):
          self.emit('switch_serial_toggled')
  
  
  if __name__ == '__main__':
      app = Application()
      exit_status = app.run(sys.argv)
      sys.exit(exit_status)
  </code></pre>