lbout.py
À propos du fichier
- Type de fichier
- Fichier PY de < 1 Ko (text/x-python)
- Confidentialité
- Fichier public, envoyé le 11 juillet 2013 à 21:21, depuis l'adresse IP 82.227.x.x (France)
- Sécurité
- Ne contient aucun Virus ou Malware connus - Dernière vérification: hier
- Statistiques
- La présente page de téléchargement a été vue 962 fois depuis l'envoi du fichier
- Page de téléchargement
-
Aperçu du fichier
#!/usr/bin/python
from gi.repository import Gtk
class RadioButtonWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="RadioButton Demo")
self.set_border_width(10)
def on_button_toggled(self, button, name):
if button.get_active():
state = "on"
else:
state = "off"
print("Button", name, "was turned", state)
win = RadioButtonWindow()
win.connect("delete-event", Gtk.main_quit)
hbox = Gtk.Box(spacing=6, orientation=Gtk.Orientation.VERTICAL)
win.add(hbox)
lbutton = []
conn = None
for i in range(5) :
name = "Lbutton" + str(i)
lbutton.append(Gtk.RadioButton.new_with_label_from_widget(conn, name))
lbutton[i].set_label(name)
lbutton[i].connect("toggled", win.on_button_toggled, str(i))
hbox.pack_start(lbutton[i], False, False, 0)
conn = lbutton[i]
win.show_all()
Gtk.main()
Partager le fichier lbout.py sur le Web et les réseaux sociaux:
Télécharger le fichier lbout.py