On Thu, 17 Jan 2013 12:52:36 -0600
Russell Adams <rlad...@adamsinfoserv.com> wrote:

> 
> I can appreciate that. Is there a "proper" way to reset a Variable to
> it's original state?

There is the Variable's _default attribute, but I don't think that
it helps much, and since it is a "hidden" attribute, I don't think using
it could be considered "proper"

In your case maybe creating a custom StringVar class with a modified
set() might be the most handy approach, like:

class MyStringVar(StringVar):
    def __init__(self, *args, **kw):
        StringVar.__init__(self, *args, **kw)
    def set(self, value):
        if value is None:
            value = ''
        return StringVar.set(self, value)

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

You can't evaluate a man by logic alone.
                -- McCoy, "I, Mudd", stardate 4513.3
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to