title: Alternating Switches ON/OFF?
body: <p>So I want to have my small Python Gtk window have 2 switches. When one switch is ON, the other is turned OFF, and vice versa. I am not too sure how to control both switches. If anyone can lead me in the right direction, it'd be much appreciated.</p>
  
  <pre><code>#!/usr/bin/python3
  
  import gi
  gi.require_version('Gtk', '3.0')
  from gi.repository import Gtk
  
  class SwitcherWindow(Gtk.Window):
  
  def __init__(self):
      Gtk.Window.__init__(self, title="Alt Switch Demo")
      self.set_border_width(10)
  
      hbox = Gtk.Box(spacing=10)
      self.add(hbox)
  
      switch1 = Gtk.Switch()
      switch1.connect("notify::active", self.on_switch_activated)
      switch1.set_active(True)
      hbox.pack_start(switch1, True, True, 0)
  
      switch2 = Gtk.Switch()
      switch2.connect("notify::active", self.on_switch_activated)
      switch2.set_active(False)
      hbox.pack_start(switch2, True, True, 0)
  
      if switch1.get_active():
          switch2.set_active(False)
      else:
          switch2.set_active(True)
  
  def on_switch_activated(self, switch, gparam):
      builder = Gtk.Builder()
      sw1 = builder.get_object("switch1")
      sw2 = builder.get_object("switch2")
      if switch.get_active():
          state = "on"
          sw2.set_active(False)
      else:
          state = "off"
          print("Switch was turned", state)
  
  win = SwitcherWindow()
  win.connect("destroy", Gtk.main_quit)
  win.show_all()
  Gtk.main()
  </code></pre>