[Tutor] Tkinter's Label

Alan Gauld alan.gauld at btinternet.com
Wed Feb 16 10:13:04 CET 2011


"Emeka" <emekamicro at gmail.com> wrote

> in order to change "text" , I could do the this
> 
> label[text] = "pool"
> 
> I do know that there is something like this..
> 
> label.configure(text = "pool")

For singlealue changes it's largely a matter of taste 
but I personally use the dictionary form for a single 
value change and configure() where I am changing 
multiple values at the same time. (Otherwise I'd 
need to have multiple lines changing one value each...)

Thus, if the new label were very long and you wanted 
to change the width of the control to accomodate it 
you could do

label.configure(text='a very long message indeed', width=50)

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/





More information about the Tutor mailing list