[Tutor] The case of the scrolling label....

alan.gauld@bt.com alan.gauld@bt.com
Sun Dec 8 19:06:02 2002


> I am putting up a label when an improper entry is received.
> 
> Label(text='Invalid Entry').pack() # Tk

Usually its better to have an empty label already within the GUI 
design then simply set its text attribute....

> Works fine. But how do I get rid of it? Multiple improper 
> entries yield:
> 
> Invalid Entry
> Invalid Entry
> Invalid Entry

If you really must create them dynamically you should find an 
unpack() method exists (it certainly does in Tcl/Tk itself!)

> I want to be able to place labels (or a "clear") 

Just clear the text attribute of the original Label...

lError = Label(parent,.....)
lError.pack(....)
lError['text'] = "Invalid Entry"  # set it
lError['text'] = ""               # clear it


> Is it possible without placing the
> label in its own frame?

Why not use a frame? Frames are your friend when using Tk!
Especially with the packer layout manager...

Alan g.