Re: [Tkinter-discuss] Tkinter-discuss Digest, Vol 34, Issue 5
Hiya G G In case you're a freak about namespace polution (and that's really a good thing), you can generally rest assured that you'll be almost always fine when you do a full namespace import of Tkinter module. Harlin Seritt tkinter-discuss-request@python.org wrote: Send Tkinter-discuss mailing list submissions to tkinter-discuss@python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/tkinter-discuss or, via email, send a message with subject or body 'help' to tkinter-discuss-request@python.org You can reach the person managing the list at tkinter-discuss-owner@python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Tkinter-discuss digest..." Today's Topics: 1. Radiobutton issue (G G) 2. Re: Radiobutton issue (Bob Greschke) ---------------------------------------------------------------------- Message: 1 Date: Wed, 6 Dec 2006 06:13:08 -0800 (PST) From: G G Subject: [Tkinter-discuss] Radiobutton issue To: tkinter-discuss@python.org Message-ID: <858548.5793.qm@web36703.mail.mud.yahoo.com> Content-Type: text/plain; charset="iso-8859-1" Hello, I was trying to disable Radiobutton widget, with passing Tkinter.Radiobutton(...,state='disabled') . also tried Tkinter.Radiobutton(...,state=Tkinter.DISABLED) and Tkinter.Radiobutton(...,state=DISABLED) and but no success. In first two cases there is no error message but radiobutton doesn't get disabled... In the third case I got Python error saying DISABLED is not defined. Is there any known issue/problem with disabling Radiobutton widget? thanks a lot --------------------------------- Everyone is raving about the all-new Yahoo! Mail beta.
----- Original Message ----- From: Harlin Seritt To: tkinter-discuss@python.org Sent: Thursday, December 07, 2006 4:14 AM Subject: Re: [Tkinter-discuss] Tkinter-discuss Digest, Vol 34, Issue 5 Hiya G G In case you're a freak about namespace polution (and that's really a good thing), you can generally rest assured that you'll be almost always fine when you do a full namespace import of Tkinter module. Harlin Seritt ======= Yeah, I forgot to mention that using something like from Tkinter import * can get you into trouble if you happen to do something like name a variable "Radiobutton". To see a list of things you shouldn't name variables and functions you can start the Python interpreter, enter 'from Tkinter import *' and then dir() and it will list everything...although you also have to then enter commands like dir(__builtins__), etc. to get the complete list. Is there a way to get the complete list of used keywords with one command? In my programs my variables always start with an upper case letter and my functions always start with a lower case letter (that's just backwards to normal human beings) which has seemed to keep me out of trouble for about 300,000 lines of code. I usually do things like from time import sleep, gmtime, time instead of using from time import *. I guess it's only Tkinter where I import *. Bob
I've always disliked the "from xxx import *" paradigm, specifically because it makes it harder to recognize where certain symbols come from. As the Zen of Python teaches us, "Namespaces are one honking great idea!" As an alternative I use "import Tkinter as T". This doesn't increase the typing burden much --- Button(...) becomes T.Button(...) --- but it always allows me to recognize any symbols belonging to Tkinter's namespace. Just my two cents. Dave
Re: [Tkinter-discuss] Tkinter-discuss Digest, Vol 34, Issue 5I have a "form" in my program that has a Text() field with a little text, some Buttons with pictures, and some Labels inserted into it. If I just do a Text().get(0.0, END) all I get is the text. Is there a way to get, pardon my C, a pointer to the Labels so I can cget the text from them? A picture of my form: www.greschke.com/unlinked/images/getem.jpg I specifically want the 7-digit number in the light blue areas (the Labels). I can keep a list of the numbers as I insert the Labels, but the user may edit some of them out of the list (like with the keyboard), so then my list wouldn't match. Thanks! Bob
On Sun, Dec 10, 2006 at 03:25:00PM -0700, Bob Greschke wrote: . . .
Re: [Tkinter-discuss] Tkinter-discuss Digest, Vol 34, Issue 5I have a "form" in my program that has a Text() field with a little text, some Buttons with pictures, and some Labels inserted into it. If I just do a Text().get(0.0, END) all I get is the text. Is there a way to get, pardon my C, a pointer to the Labels so I can cget the text from them?
A picture of my form: www.greschke.com/unlinked/images/getem.jpg
I specifically want the 7-digit number in the light blue areas (the Labels). I can keep a list of the numbers as I insert the Labels, but the user may edit some of them out of the list (like with the keyboard), so then my list wouldn't match. . . . I like the JPEG; it's always a treat to see how Tkinter helps folks.
I apologize for letting this request languish so long. While I shan't make the time now to recode your application, I believe the answer you sought is something like this: you probably did a my_label = Tkinter.Label(text = "See me?") my_label_instance = window_create(index, window = my_label) (see <URL: http://effbot.org/tkinterbook/text.htm >) to insert the Label. The return value from window_create() will be a "Tkinter.Label instance"; you can just my_label_instance.cget("text") at that point.
participants (4)
-
Bob Greschke -
Cameron Laird -
Harlin Seritt -
Opstad, Dave