| [Tk] radiobutton vs button |
|
 |
|
 |
|
 |
|
 |
Group: fr.comp.lang.python · Group Profile
Author: znortznort Date: Oct 11, 2006 10:15
salut,
dans le programme (très complexe...) suivant,
j'utilise un radiobutton pour récupérer une valeur,
et esthétiquement, c'est moche !
y-a-t'il un moyen de récupérer le texte d'un Button ?
# !/usr/bin/python
from Tkinter import *
root=Tk()
var=StringVar()
def affich():
print var.get()
i=1
while(i<5):
rb=Radiobutton(root,text=i,value=i,variable=var,command=affich)
rb.pack()
i=i+1
root.mainloop()
|