def on_button_toggled(self, button, name):
if button.get_active(): # this part is to deactivate all button when one is activated
for i in self.vbox:
if type(i) == Gtk.ToggleButton:
if i != button:
i.set_active(False)
else:
k = 0 # this part is to activate button 1 when all is deactivated
for i in self.vbox:
if type(i) == Gtk.ToggleButton:
m = i.get_active()
k = k + m
if k == 0:
self.button1.set_active(True)
评论列表
文章目录