[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>&nbsp; Hi all,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; I upgraded to 2.1, and now it seems this code acts quite=20
differently.</DIV>
<DIV>&nbsp;</DIV>
<DIV>###</DIV>
<DIV>from Tkinter import *</DIV>
<DIV>&nbsp;</DIV>
<DIV>def pjim(jim):<BR>&nbsp;&nbsp;&nbsp; print jim</DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV>&nbsp; Of course, it was alot more complicated originally - so I =
compressed=20
it down until I have come to this.&nbsp; For the life of me, I cannot =
get a=20
little white 'radiobutton' to appear - only the text for each =
radiobutton.</DIV>
<DIV>&nbsp; If I change the fg&nbsp;and/or bg (foreground, background) =
of a=20
single radiobutton then it changes when I click on =
it...however,&nbsp;using the=20
printjim button&nbsp;it tells me that jim&nbsp;in fact does not change =
upon=20
clicking&nbsp;just the text.</DIV>
<DIV>&nbsp; Any ideas or help?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; Thanks,</DIV>
<DIV>&nbsp; Glen.&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_000E_01C0E8FB.EF654280--