This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author droun
Recipients
Date 2005-04-07.21:01:52
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
in class Variable the constructor uses self.set() to set 
the value of the variable. This makes it hard and in some 
cases impossible to make a speciallization of Variable 
that performs some operation after changing the value. It 
would be preferable to use Tkinter.Variable.set(self, 
self._default)

example:

class ViewChanger(Tkinter.StringVar) :

    def __init__(self, views) :
        self.views = views
        Tkinter.StringVar.__init__(self)

    def set(self, newview) :
        self.views.activate(newview)
        Tkinter.StringVar.set(newview)

get() and everything else will use the normal StringVar 
ipementation, but when the value is changed, a new view 
is activated.
At creation here the self.views varaible will be accessed, 
method activate() will be called, and it might not even be 
fully initiallized yet. This is the normal case if you want 
to supply a variable to a widget, where a variable change 
may update the widget. 
History
Date User Action Args
2008-01-20 09:57:44adminlinkissue1178863 messages
2008-01-20 09:57:44admincreate