[tkinter] Making invisible label doesn't work

Post here if you need help with creating a Graphical User Interface in Python.

[tkinter] Making invisible label doesn't work

Postby rovf » Mon Sep 30, 2013 12:45 pm

I would like to create a label, which is initially invisible, but later can be turned "on and off". I tried this:

Code: Select all
label=Label(self.widget,text=' TODO THIS TEXT ',visible='no')


This gives me the error message:


File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/Tkinter.py", line 1835, in __init__
_tkinter.TclError: unknown option "-visible"


I also tried instead
Code: Select all
state=HIDDEN
, but then got the error message:

_tkinter.TclError: bad state "hidden": must be active, disabled, or normal

Note that I don't want to be it "disabled", but completely invisible. What am I doing wrong?
Last edited by Yoriz on Mon Sep 30, 2013 3:44 pm, edited 1 time in total.
Reason: changed title
rovf
 
Posts: 25
Joined: Fri Aug 16, 2013 4:35 pm

Re: Making invisible label doesn't work

Postby Yoriz » Mon Sep 30, 2013 3:43 pm

New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 871
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: [tkinter] Making invisible label doesn't work

Postby rovf » Mon Sep 30, 2013 4:15 pm

I know this post. Actually, unless I'm blind, this is exactly that type of code I'm using. The question is: What is it that I'm doing wrong?
rovf
 
Posts: 25
Joined: Fri Aug 16, 2013 4:35 pm

Re: [tkinter] Making invisible label doesn't work

Postby Yoriz » Mon Sep 30, 2013 5:44 pm

Your using the code in the question instead of the code in the answers.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 871
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: [tkinter] Making invisible label doesn't work

Postby rovf » Tue Oct 01, 2013 6:37 am

Yoriz wrote:Your using the code in the question instead of the code in the answers.


Oh my God! Shame on me! Thanks again!
rovf
 
Posts: 25
Joined: Fri Aug 16, 2013 4:35 pm


Return to GUI

Who is online

Users browsing this forum: QX11 and 3 guests