[Tutor] Tkinter
Olavi Ivask
olavi at city.ee
Thu Apr 29 16:21:56 EDT 2004
David Rock wrote:
>* Olavi Ivask <olavi at city.ee> [2004-04-29 23:14]:
>
>
>>David Rock wrote:
>>
>>
>>>label = Label(root, text="Label1").grid()
>>>
>>>assigns the grid object to the variable label, while
>>>
>>>label = Label(root, text="Label1")
>>>
>>>assigns the LABEL object to label. The second one is probably better
>>>because you are working with the primary object that you can call ALL
>>>methods for, not just grid(), while the first is limited to JUST grid()
>>>
>>>
>>>
>>>
>>can i do something like that:
>>I "define" several widgets:
>> label = Label(root, text="text")
>> label = Label(root, text="text2")
>> ...
>> label.grid()
>>
>> right now, it shows only second widget.
>>
>>
>
>No. you are overwriting the first assignment with the second. You would
>have to use label1, label2, etc. Ideally, label would be something
>vaguely descriptive so you could tell at a glance _which_ label it is
>and what it's for.
>
>
>
>
>
Thanks David for your help
Best Regards
Olavi Ivask
>------------------------------------------------------------------------
>
>_______________________________________________
>Tutor maillist - Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>
More information about the Tutor
mailing list