example Tkinter code?

Keith Murphy kpmurphy at my-deja.com
Fri Jul 21 10:48:49 EDT 2000


i would say that the best reference i've found for tkinter is fredrik
lundh's 'an introduction to tkinter'

http://www.pythonware.com/library.htm

-->keith

In article <MaSd5.1355$yE4.25940 at news2-win.server.ntlworld.com>,
  "richard_chamberlain" <richard_chamberlain at ntlworld.com> wrote:
> Hi,
>
> Have a look at John Grayson's manning site (www.manning.com/grayson)
you can
> download the source from his book including code that demonstrates
each
> widget.
>
> I really would recommend a copy as it's an excellent book.
>
> from Tkinter import *
> root=Tk()
> myString=StringVar()
> Label(root,textvariable=myString).pack()
> myString.set("Well, eh, how about a little red Leicester.")
> def changeLabel():
>     myString.set("I'm, a-fraid we're fresh out of red Leicester, sir.
")
> Button(root,text='Click Me',command=changeLabel).pack()
> root.mainloop()
>
> I presume where you're going wrong is you are not creating an instance
of
> StringVar and setting (or getting) the variable through that.
>
> Richard
> Locke <brown.2053 at osu.NOSPAM.edu> wrote in message
> news:8l7cvb$c61$1 at mcnet.marietta.edu...
> > does anyone know where i can find some example python/tkinter code?
i am
> > trying to learn, but i think some examples of how to use all those
widgets
> > would be useful.
> >
> > also, how can i change the text on a label? when i use the
> > variabletext=whatever thing, the label wont show up.
> >
> > Thanks!
> >
> >
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list