[Tutor] Code now broken with upgrade to 2.1...
Glen Wheeler
wheelege@tsn.cc
Wed, 30 May 2001 11:30:31 +1000
This is a multi-part message in MIME format.
------=_NextPart_000_000E_01C0E8FB.EF654280
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
I upgraded to 2.1, and now it seems this code acts quite differently.
###
from Tkinter import *
def pjim(jim):
print jim
root =3D Tk()
tlw =3D Toplevel(root)
jim =3D 1
f =3D Frame(tlw, height=3D100, width=3D150)
Radiobutton(f, text=3D'Path', value=3D50, variable=3Djim).pack()
Radiobutton(f, text=3D'Alright', value=3D9, variable=3Djim).pack()
Radiobutton(f, text=3D'Fun', value=3D5, variable=3Djim).pack()
Radiobutton(f, text=3D'Stupid', value=3D1, variable=3Djim).pack()
f.pack(padx=3D5, pady=3D5)
b =3D Button(tlw, text=3D'print jim', command=3Dlambda x=3Djim:pjim(x))
b.pack()
mainloop()
###
Of course, it was alot more complicated originally - so I compressed =
it down until I have come to this. For the life of me, I cannot get a =
little white 'radiobutton' to appear - only the text for each =
radiobutton.
If I change the fg and/or bg (foreground, background) of a single =
radiobutton then it changes when I click on it...however, using the =
printjim button it tells me that jim in fact does not change upon =
clicking just the text.
Any ideas or help?
Thanks,
Glen.=20
------=_NextPart_000_000E_01C0E8FB.EF654280
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV> Hi all,</DIV>
<DIV> </DIV>
<DIV> I upgraded to 2.1, and now it seems this code acts quite=20
differently.</DIV>
<DIV> </DIV>
<DIV>###</DIV>
<DIV>from Tkinter import *</DIV>
<DIV> </DIV>
<DIV>def pjim(jim):<BR> print jim</DIV>
<DIV> </DIV>
<DIV>root =3D Tk()<BR>tlw =3D Toplevel(root)<BR>jim =3D 1<BR>f =3D =
Frame(tlw,=20
height=3D100, width=3D150)<BR>Radiobutton(f, text=3D'Path', value=3D50,=20
variable=3Djim).pack()<BR>Radiobutton(f, text=3D'Alright', value=3D9,=20
variable=3Djim).pack()<BR>Radiobutton(f, text=3D'Fun', value=3D5,=20
variable=3Djim).pack()<BR>Radiobutton(f, text=3D'Stupid', value=3D1,=20
variable=3Djim).pack()<BR>f.pack(padx=3D5, pady=3D5)<BR>b =3D =
Button(tlw, text=3D'print=20
jim', command=3Dlambda x=3Djim:pjim(x))<BR>b.pack()<BR>mainloop()</DIV>
<DIV>###</DIV>
<DIV> </DIV>
<DIV> Of course, it was alot more complicated originally - so I =
compressed=20
it down until I have come to this. For the life of me, I cannot =
get a=20
little white 'radiobutton' to appear - only the text for each =
radiobutton.</DIV>
<DIV> If I change the fg and/or bg (foreground, background) =
of a=20
single radiobutton then it changes when I click on =
it...however, using the=20
printjim button it tells me that jim in fact does not change =
upon=20
clicking just the text.</DIV>
<DIV> Any ideas or help?</DIV>
<DIV> </DIV>
<DIV> Thanks,</DIV>
<DIV> Glen. </DIV></BODY></HTML>
------=_NextPart_000_000E_01C0E8FB.EF654280--