[Tutor] Tkinter's Label
Emeka
emekamicro at gmail.com
Wed Feb 16 11:02:09 CET 2011
Alan,
Thanks so much.
Is the below the standard way of checking the content of Label in "if"
statement?
root = Tk()
label = Label(root , text = "pure")
if label["pure"] == "pure":
Regards,
Emeka
On Wed, Feb 16, 2011 at 10:13 AM, Alan Gauld <alan.gauld at btinternet.com>wrote:
>
> "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/
>
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
*Satajanus Nig. Ltd
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110216/461c7aea/attachment.html>
More information about the Tutor
mailing list