If you want the function to be run most of the time the toggle signal is emitted, and not when you manually toggle it (e.g. when loading saved settings and displaying the appropriate state), then you need to block and unblock the signal. To do so you'll need the handle_id that was returned when the signal was connected to the function. Just assign a variable when you connect the signal. Here's an example:
#!/usr/bin/python
from gi.repository import Gtk
def on_toggle(widget,data=None):
print "toggled, emitted signal"
def on_button1_clicked(widget, data=None):
print "manually toggle, no signal"
toggle.handler_block(handle_id)
state=toggle.get_active()
toggle.set_active(not state)
toggle.handler_unblock(handle_id)
win=Gtk.Window()
win.connect('destroy', Gtk.main_quit)
box=Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
button1=Gtk.Button('Toggle with no signal')
button1.connect('clicked', on_button1_clicked)
button1.show()
box.pack_start(button1,True,True,10)
toggle=Gtk.ToggleButton('Toggle')
handle_id=toggle.connect('toggled', on_toggle)
toggle.show()
box.pack_start(toggle,True,True,0)
box.show_all()
win.add(box)
win.show()
Gtk.main()